blob: f0ab339351ac028c46ad94d47e06cd34e4920414 [file] [log] [blame]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08001= Gerrit Code Review - Configuration
Shawn O. Pearced2b73db2009-01-09 11:55:47 -08002
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08003== File `etc/gerrit.config`
Shawn O. Pearce51967cd2009-05-08 19:46:57 -07004
Shawn O. Pearcec5fed822009-11-17 16:10:10 -08005The optional file `'$site_path'/etc/gerrit.config` is a Git-style
6config file that controls many host specific settings for Gerrit.
Shawn O. Pearce51967cd2009-05-08 19:46:57 -07007
8[NOTE]
Shawn O. Pearcec5fed822009-11-17 16:10:10 -08009The contents of the `etc/gerrit.config` file are cached at startup
Brandon Casey4a21add2011-07-05 13:14:18 -050010by Gerrit. If you modify any properties in this file, Gerrit needs
Shawn O. Pearce51967cd2009-05-08 19:46:57 -070011to be restarted before it will use the new values.
12
Shawn O. Pearcec5fed822009-11-17 16:10:10 -080013Sample `etc/gerrit.config`:
Shawn O. Pearce51967cd2009-05-08 19:46:57 -070014----
15[core]
Shawn O. Pearce9d342a42009-12-16 15:49:05 -080016 packedGitLimit = 200 m
Shawn O. Pearce51967cd2009-05-08 19:46:57 -070017
18[cache]
Shawn O. Pearce9d342a42009-12-16 15:49:05 -080019 directory = /var/cache/gerrit2
Shawn O. Pearce51967cd2009-05-08 19:46:57 -070020----
21
Yuxuan 'fishy' Wang3fba03a2013-12-10 15:08:11 -080022[[accounts]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -080023=== Section accounts
Dave Borowitz45baa892012-02-23 16:43:05 -080024
Matthias Sohnf3360662012-04-05 15:42:52 +020025[[accounts.visibility]]accounts.visibility::
Dave Borowitz45baa892012-02-23 16:43:05 -080026+
27Controls visibility of other users' dashboard pages and
28completion suggestions to web users.
29+
30If `ALL`, all users are visible to all other users, even
31anonymous users.
32+
33If `SAME_GROUP`, only users who are also members of a group the
34current user is a member of are visible.
35+
36If `VISIBLE_GROUP`, only users who are members of at least one group
37that is visible to the current user are visible.
38+
39If `NONE`, no users other than the current user are visible.
40+
41Default is `ALL`.
42
Yuxuan 'fishy' Wang3fba03a2013-12-10 15:08:11 -080043[[addreviewer]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -080044=== Section addreviewer
Edwin Kempin49cb3e12011-06-29 14:35:14 +020045
46[[addreviewer.maxWithoutConfirmation]]addreviewer.maxWithoutConfirmation::
47+
48The maximum number of reviewers a user can add at once by adding a
49group as reviewer without being asked to confirm the operation.
50+
51If set to 0, the user will never be asked to confirm adding a group
52as reviewer.
53+
54Default is 10.
Edwin Kempin5e65d9b2011-07-08 07:35:48 +020055+
56This setting only applies for adding reviewers in the Gerrit WebUI,
57but is ignored when adding reviewers with the
Edwin Kempin33e92d02011-07-11 22:00:57 +020058link:cmd-set-reviewers.html[set-reviewers] command.
Edwin Kempin49cb3e12011-06-29 14:35:14 +020059
60[[addreviewer.maxAllowed]]addreviewer.maxAllowed::
61+
62The maximum number of reviewers a user can add at once by adding a
63group as reviewer.
64+
65If set to 0, there is no limit for the number of reviewers that can
66be added at once by adding a group as reviewer.
67+
68Default is 20.
69
Yuxuan 'fishy' Wang3fba03a2013-12-10 15:08:11 -080070[[auth]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -080071=== Section auth
Shawn O. Pearce0d3ecff2009-06-01 08:34:17 -070072
73See also link:config-sso.html[SSO configuration].
74
Shawn O. Pearce92a7fd12009-08-18 19:52:48 -070075[[auth.type]]auth.type::
Shawn O. Pearce0d3ecff2009-06-01 08:34:17 -070076+
Shawn O. Pearce2920ef32009-08-03 08:03:34 -070077Type of user authentication employed by Gerrit. The supported
78values are:
Shawn O. Pearce0d3ecff2009-06-01 08:34:17 -070079+
80* `OpenID`
81+
82The default setting. Gerrit uses any valid OpenID
83provider chosen by the end-user. For more information see
Shawn O. Pearce2920ef32009-08-03 08:03:34 -070084http://openid.net/[openid.net].
Shawn O. Pearce0d3ecff2009-06-01 08:34:17 -070085+
James E. Blairca8bc3b2011-12-21 18:12:26 +000086* `OpenID_SSO`
87+
88Supports OpenID from a single provider. There is no registration
89link, and the "Sign In" link sends the user directly to the provider's
90SSO entry point.
91+
Shawn O. Pearce0d3ecff2009-06-01 08:34:17 -070092* `HTTP`
93+
Shawn O. Pearce2920ef32009-08-03 08:03:34 -070094Gerrit relies upon data presented in the HTTP request. This includes
Edwin Kempinf1acbb82011-09-15 12:49:42 +020095HTTP basic authentication, or some types of commercial single-sign-on
Shawn O. Pearce2920ef32009-08-03 08:03:34 -070096solutions. With this setting enabled the authentication must
97take place in the web server or servlet container, and not from
98within Gerrit.
99+
Shawn O. Pearce302a7dd2009-08-18 19:33:15 -0700100* `HTTP_LDAP`
101+
102Exactly like `HTTP` (above), but additionally Gerrit pre-populates
103a user's full name and email address based on information obtained
104from the user's account object in LDAP. The user's group membership
105is also pulled from LDAP, making any LDAP groups that a user is a
106member of available as groups in Gerrit.
107+
Sasa Zivkoveabc8972010-10-04 15:47:08 +0200108* `CLIENT_SSL_CERT_LDAP`
109+
110This authentication type is actually kind of SSO. Gerrit will configure
David Pursehouse221d4f62012-06-08 17:38:08 +0900111Jetty's SSL channel to request the client's SSL certificate. For this
Sasa Zivkoveabc8972010-10-04 15:47:08 +0200112authentication to work a Gerrit administrator has to import the root
113certificate of the trust chain used to issue the client's certificate
114into the <review-site>/etc/keystore.
115After the authentication is done Gerrit will obtain basic user
116registration (name and email) from LDAP, and some group memberships.
117Therefore, the "_LDAP" suffix in the name of this authentication type.
118This authentication type can only be used under hosted daemon mode, and
119the httpd.listenUrl must use https:// as the protocol.
Chulho Yangb72ff8f2013-07-04 02:35:53 -0400120Optionally, certificate revocation list file can be used
121at <review-site>/etc/crl.pem. For details, see httpd.sslCrl.
Sasa Zivkoveabc8972010-10-04 15:47:08 +0200122+
Shawn O. Pearcef7e065e2009-09-26 20:01:10 -0700123* `LDAP`
124+
125Gerrit prompts the user to enter a username and a password, which
126it then verifies by performing a simple bind against the configured
127<<ldap.server,ldap.server>>. In this configuration the web server
128is not involved in the user authentication process.
129+
Shawn O. Pearcec892d342010-02-17 17:00:50 -0800130The actual username used in the LDAP simple bind request is the
131account's full DN, which is discovered by first querying the
132directory using either an anonymous request, or the configured
Robin Rosenberga3baed02012-10-14 14:09:32 +0200133<<ldap.username,ldap.username>> identity. Gerrit can also use kerberos if
134<<ldap.authentication,ldap.authentication>> is set to `GSSAPI`.
Shawn O. Pearcec892d342010-02-17 17:00:50 -0800135
136* `LDAP_BIND`
137+
138Gerrit prompts the user to enter a username and a password, which
139it then verifies by performing a simple bind against the configured
140<<ldap.server,ldap.server>>. In this configuration the web server
141is not involved in the user authentication process.
142+
David Pursehouse42f42042013-08-01 14:02:25 +0900143Unlike `LDAP` above, the username used to perform the LDAP simple bind
David Pursehouse1344f5b2013-08-09 17:35:47 +0900144request is the exact string supplied in the dialog by the user.
Robin Rosenberg524a3032012-10-14 14:24:36 +0200145The configured <<ldap.username,ldap.username>> identity is not used to obtain
Shawn O. Pearcec892d342010-02-17 17:00:50 -0800146account information.
147+
Shawn O. Pearce2920ef32009-08-03 08:03:34 -0700148* `DEVELOPMENT_BECOME_ANY_ACCOUNT`
149+
150*DO NOT USE*. Only for use in a development environment.
151+
152When this is the configured authentication method a hyperlink titled
153`Become` appears in the top right corner of the page, taking the
154user to a form where they can enter the username of any existing
155user account, and immediately login as that account, without any
156authentication taking place. This form of authentication is only
157useful for the GWT hosted mode shell, where OpenID authentication
158redirects might be risky to the developer's host computer, and HTTP
159authentication is not possible.
Shawn O. Pearce0d3ecff2009-06-01 08:34:17 -0700160
161+
162By default, OpenID.
163
Shawn O. Pearce533cafc2010-05-11 16:05:27 -0700164[[auth.allowedOpenID]]auth.allowedOpenID::
165+
166List of permitted OpenID providers. A user may only authenticate
167with an OpenID that matches this list. Only used if `auth.type`
David Pursehouse42f42042013-08-01 14:02:25 +0900168is set to `OpenID` (the default).
Shawn O. Pearce533cafc2010-05-11 16:05:27 -0700169+
Magnus Bäcke5611832011-02-02 08:57:15 +0100170Patterns may be either a
171link:http://download.oracle.com/javase/6/docs/api/java/util/regex/Pattern.html[standard
172Java regular expression (java.util.regex)] (start with `^` and
Shawn O. Pearce533cafc2010-05-11 16:05:27 -0700173end with `$`) or be a simple prefix (any other string).
174+
175By default, the list contains two values, `http://` and `https://`,
176allowing users to authenticate with any OpenID provider.
177
Shawn O. Pearce92a7fd12009-08-18 19:52:48 -0700178[[auth.trustedOpenID]]auth.trustedOpenID::
Shawn O. Pearced7c026d2009-08-05 20:11:22 -0700179+
David Pursehouse221d4f62012-06-08 17:38:08 +0900180List of trusted OpenID providers. Only used if `auth.type` is
David Pursehouse42f42042013-08-01 14:02:25 +0900181set to `OpenID` (the default).
Shawn O. Pearced7c026d2009-08-05 20:11:22 -0700182+
183In order for a user to take advantage of permissions beyond those
184granted to the `Anonymous Users` and `Registered Users` groups,
185the user account must only have OpenIDs which match at least one
186pattern from this list.
187+
Magnus Bäcke5611832011-02-02 08:57:15 +0100188Patterns may be either a
189link:http://download.oracle.com/javase/6/docs/api/java/util/regex/Pattern.html[standard
190Java regular expression (java.util.regex)] (start with `^` and
Shawn O. Pearced7c026d2009-08-05 20:11:22 -0700191end with `$`) or be a simple prefix (any other string).
192+
193By default, the list contains two values, `http://` and `https://`,
194allowing Gerrit to trust any OpenID it receives.
195
Mike Goulined2ab0cd2012-12-18 11:20:53 +1100196[[auth.openIdDomain]]auth.openIdDomain::
197+
198List of allowed OpenID email address domains. Only used if
David Pursehouse42f42042013-08-01 14:02:25 +0900199`auth.type` is set to `OPENID` or `OPENID_SSO`.
Mike Goulined2ab0cd2012-12-18 11:20:53 +1100200+
201Domain is case insensitive and must be in the same form as it
202appears in the email address, for example, "example.com".
203+
204By default, any domain is accepted.
205
Shawn O. Pearce89030bc2010-04-24 17:25:29 -0700206[[auth.maxOpenIdSessionAge]]auth.maxOpenIdSessionAge::
207+
208Time in seconds before an OpenID provider must force the user
209to authenticate themselves again before authentication to this
210Gerrit server. Currently this is only a polite request, and users
211coming from providers that don't support the PAPE extension will
212be accepted anyway. In the future it may be enforced, rejecting
213users coming from providers that don't honor the max session age.
214+
215If set to 0, the provider will always force the user to authenticate
216(e.g. supply their password). Values should use common unit suffixes
217to express their setting:
218+
219* s, sec, second, seconds
220* m, min, minute, minutes
221* h, hr, hour, hours
222* d, day, days
223* w, week, weeks (`1 week` is treated as `7 days`)
224* mon, month, months (`1 month` is treated as `30 days`)
225* y, year, years (`1 year` is treated as `365 days`)
226
227+
228Default is -1, permitting infinite time between authentications.
229
Shawn O. Pearce34f38cf2011-06-16 19:18:54 -0700230[[auth.maxRegisterEmailTokenAge]]auth.maxRegisterEmailTokenAge::
231+
232Time in seconds before an email verification token sent to a user in
233order to validate their email address expires.
234+
235* s, sec, second, seconds
236* m, min, minute, minutes
237* h, hr, hour, hours
238* d, day, days
239* w, week, weeks (`1 week` is treated as `7 days`)
240* mon, month, months (`1 month` is treated as `30 days`)
241* y, year, years (`1 year` is treated as `365 days`)
242
243+
Shawn O. Pearced6bd00b2012-01-20 12:40:51 -0800244Default is 12 hours.
Shawn O. Pearce34f38cf2011-06-16 19:18:54 -0700245
James E. Blairca8bc3b2011-12-21 18:12:26 +0000246[[auth.openIdSsoUrl]]auth.openIdSsoUrl::
247+
David Pursehouse42f42042013-08-01 14:02:25 +0900248The SSO entry point URL. Only used if `auth.type` is set to
249`OpenID_SSO`.
James E. Blairca8bc3b2011-12-21 18:12:26 +0000250+
251The "Sign In" link will send users directly to this URL.
252
Shawn O. Pearce92a7fd12009-08-18 19:52:48 -0700253[[auth.httpHeader]]auth.httpHeader::
Shawn O. Pearce0d3ecff2009-06-01 08:34:17 -0700254+
255HTTP header to trust the username from, or unset to select HTTP basic
David Pursehouse42f42042013-08-01 14:02:25 +0900256or digest authentication. Only used if `auth.type` is set to `HTTP`.
Shawn O. Pearce0d3ecff2009-06-01 08:34:17 -0700257
Luca Milanesio384ed6c2013-07-30 09:10:07 +0100258[[auth.httpDisplaynameHeader]]auth.httpDisplaynameHeader::
259+
260HTTP header to retrieve the user's display name from. Only used if `auth.type`
261is set to `HTTP`.
262+
263If set, Gerrit trusts and enforces the user's full name using the HTTP header
264and disables the ability to manually modify the user's full name
265from the contact information page.
266
267[[auth.httpEmailHeader]]auth.httpEmailHeader::
268+
269HTTP header to retrieve the user's e-mail from. Only used if `auth.type`
270is set to `HTTP`.
271+
272If set, Gerrit trusts and enforces the user's e-mail using the HTTP header
273and disables the ability to manually modify or register other e-mails
274from the contact information page.
275
Luca Milanesio5185b042013-07-27 22:03:06 +0100276[[auth.loginUrl]]auth.loginUrl::
277+
278URL to redirect a browser to after the end-user has clicked on the
David Pursehouse42f42042013-08-01 14:02:25 +0900279login link in the upper right corner. Only used if `auth.type` is set
280to `HTTP` or `HTTP_LDAP`.
Luca Milanesio5185b042013-07-27 22:03:06 +0100281Organizations using an enterprise single-sign-on solution may want to
282redirect the browser to the SSO product's sign-in page for completing the
283login process and validate their credentials.
284+
David Pursehouse42f42042013-08-01 14:02:25 +0900285If set, Gerrit allows anonymous access until the end-user performs the login
286and provides a trusted identity through the HTTP header.
Luca Milanesio5185b042013-07-27 22:03:06 +0100287If not set, Gerrit requires the HTTP header with a trusted identity
David Pursehouse42f42042013-08-01 14:02:25 +0900288and returns the error page 'LoginRedirect.html' if such a header is not
289present.
Luca Milanesio5185b042013-07-27 22:03:06 +0100290
291[[auth.loginText]]auth.loginText::
292+
David Pursehouse42f42042013-08-01 14:02:25 +0900293Text displayed in the loginUrl link. Only used if `auth.loginUrl` is set.
Luca Milanesio5185b042013-07-27 22:03:06 +0100294+
David Pursehouse42f42042013-08-01 14:02:25 +0900295If not set, the "Sign In" text is used.
Luca Milanesio5185b042013-07-27 22:03:06 +0100296
Luca Milanesio111e0b72013-08-15 18:56:42 +0100297[[auth.registerPageUrl]]auth.registerPageUrl::
298+
David Pursehouse268744b2013-08-17 15:32:11 +0900299URL of the registration page to use when a new user logs in to Gerrit for
300the first time. Used only when `auth.type` is set to `HTTP`.
Luca Milanesio111e0b72013-08-15 18:56:42 +0100301+
302If not set, the standard Gerrit registration page `/#/register/` is displayed.
303
Shawn O. Pearce92a7fd12009-08-18 19:52:48 -0700304[[auth.logoutUrl]]auth.logoutUrl::
Shawn O. Pearce12b5d842009-08-15 15:11:10 -0700305+
306URL to redirect a browser to after the end-user has clicked on the
307"Sign Out" link in the upper right corner. Organizations using an
308enterprise single-sign-on solution may want to redirect the browser
309to the SSO product's sign-out page.
310+
311If not set, the redirect returns to the list of all open changes.
312
Shawn O. Pearcec9d26b52009-12-16 08:05:27 -0800313[[auth.registerUrl]]auth.registerUrl::
314+
315Target for the "Register" link in the upper right corner. Used only
David Pursehouse42f42042013-08-01 14:02:25 +0900316when `auth.type` is `LDAP`.
Shawn O. Pearcec9d26b52009-12-16 08:05:27 -0800317+
318If not set, no "Register" link is displayed.
319
Chad Horohoe65897082012-11-10 10:26:25 -0800320[[auth.registerText]]auth.registerText::
321+
322Text for the "Register" link in the upper right corner. Used only
David Pursehouse42f42042013-08-01 14:02:25 +0900323when `auth.type` is `LDAP`.
Chad Horohoe65897082012-11-10 10:26:25 -0800324+
325If not set, defaults to "Register".
326
David Pursehouse3d604492013-01-25 17:41:53 +0900327[[auth.editFullNameUrl]]auth.editFullNameUrl::
328+
329Target for the "Edit" button when the user is allowed to edit their
330full name.
331
332[[auth.httpPasswordUrl]]auth.httpPasswordUrl::
333+
David Pursehouse42f42042013-08-01 14:02:25 +0900334Target for the "Obtain Password" link. Used only when `auth.type` is
David Pursehouse3d604492013-01-25 17:41:53 +0900335`LDAP`, `LDAP_BIND` or `CUSTOM_EXTENSION`.
Shawn Pearcee0cafe42013-08-29 23:28:13 -0700336
337[[auth.switchAccountUrl]]auth.switchAccountUrl::
David Pursehouse3d604492013-01-25 17:41:53 +0900338+
Shawn Pearcee0cafe42013-08-29 23:28:13 -0700339URL to switch user identities and login as a different account than
340the currently active account. This is disabled by default except when
341`auth.type` is `OPENID` and `DEVELOPMENT_BECOME_ANY_ACCOUNT`. If set
342the "Switch Account" link is displayed next to "Sign Out".
343+
344When `auth.type` does not normally enable this URL administrators may
345set this to `login/` or `$canonicalWebUrl/login`, allowing users to
346begin a new web session.
David Pursehouse3d604492013-01-25 17:41:53 +0900347
Piotr Sikora7cec2f82011-02-26 12:57:30 +0000348[[auth.cookiePath]]auth.cookiePath::
349+
350Sets "path" attribute of the authentication cookie.
351+
352If not set, HTTP request's path is used.
353
354[[auth.cookieSecure]]auth.cookieSecure::
355+
356Sets "secure" flag of the authentication cookie. If true, cookies
357will be transmitted only over HTTPS protocol.
358+
359By default, false.
360
Shawn O. Pearce92a7fd12009-08-18 19:52:48 -0700361[[auth.emailFormat]]auth.emailFormat::
Shawn O. Pearce0d3ecff2009-06-01 08:34:17 -0700362+
363Optional format string to construct user email addresses out of
David Pursehouse42f42042013-08-01 14:02:25 +0900364user login names. Only used if `auth.type` is `HTTP`, `HTTP_LDAP`
Shawn O. Pearcef7e065e2009-09-26 20:01:10 -0700365or `LDAP`.
Shawn O. Pearce0d3ecff2009-06-01 08:34:17 -0700366+
Shawn O. Pearce44221bf2011-06-27 10:37:30 -0700367This value can be set to a format string, where `{0}` is replaced
Shawn O. Pearce0d3ecff2009-06-01 08:34:17 -0700368with the login name. E.g. "\{0\}+gerrit@example.com" with a user
369login name of "foo" will produce "foo+gerrit@example.com" during
370the first time user "foo" registers.
Shawn O. Pearce302a7dd2009-08-18 19:33:15 -0700371+
Shawn O. Pearcef7e065e2009-09-26 20:01:10 -0700372If the site is using `HTTP_LDAP` or `LDAP`, using this option is
373discouraged. Setting `ldap.accountEmailAddress` and importing the
374email address from the LDAP directory is generally preferred.
Shawn O. Pearce0d3ecff2009-06-01 08:34:17 -0700375
Shawn O. Pearce92a7fd12009-08-18 19:52:48 -0700376[[auth.contributorAgreements]]auth.contributorAgreements::
Shawn O. Pearce0d3ecff2009-06-01 08:34:17 -0700377+
378Controls whether or not the contributor agreement features are
379enabled for the Gerrit site. If enabled a user must complete a
380contributor agreement before they can upload changes.
381+
Marc Petit-Hugueninbbb85492012-12-03 11:11:00 -0800382If enabled, the admin must also add one or more
383link:config-cla.html[contributor-agreement sections]
384in project.config and create agreement files under
Shawn O. Pearce0d3ecff2009-06-01 08:34:17 -0700385`'$site_path'/static`, so users can actually complete one or
Grzegorz Kossakowski28e4e1b2009-09-23 11:33:34 -0700386more agreements.
Shawn O. Pearce0d3ecff2009-06-01 08:34:17 -0700387+
388By default this is false (no agreements are used).
Fredrik Luthandera3cf3542012-07-04 16:55:35 -0700389+
390To enable the actual usage of contributor agreement the project
391specific config option in the `project.config` must be set:
392link:config-project-config.html[receive.requireContributorAgreement].
Shawn O. Pearce0d3ecff2009-06-01 08:34:17 -0700393
Shawn O. Pearce0d3ecff2009-06-01 08:34:17 -0700394auth.allowGoogleAccountUpgrade::
395+
Shawn O. Pearce48eea072009-08-31 10:53:12 -0700396Allows Google Account users to automatically update their Gerrit
397account when/if their Google Account OpenID identity token changes.
398Identity tokens can change if the server changes hostnames, or
399for other reasons known only to Google. The upgrade path works
400by matching users by email address if the identity is not present,
401and then changing the identity.
Shawn O. Pearce0d3ecff2009-06-01 08:34:17 -0700402+
Shawn O. Pearce48eea072009-08-31 10:53:12 -0700403This setting also permits old Gerrit 1.x users to seamlessly upgrade
404from Google Accounts on Google App Engine to OpenID authentication.
Shawn O. Pearce0d3ecff2009-06-01 08:34:17 -0700405+
Shawn O. Pearce48eea072009-08-31 10:53:12 -0700406Having this enabled incurs an extra database query when Google
Shawn O. Pearcee31d02c2009-12-08 12:21:37 -0800407Account users register with the Gerrit server.
Shawn O. Pearce0d3ecff2009-06-01 08:34:17 -0700408+
409By default, unset/false.
410
Christian Halstricka3d88a52011-08-31 09:21:41 +0200411[[auth.trustContainerAuth]]auth.trustContainerAuth::
412+
413If true then it is the responsibility of the container hosting
414Gerrit to authenticate users. In this case Gerrit will blindly trust
415the container.
416+
417This parameter only affects git over http traffic. If set to false
418then Gerrit will do the authentication (using DIGEST authentication).
419+
420By default this is set to false.
421
Luca Milanesio42058842012-01-05 21:25:38 +0000422[[auth.gitBasicAuth]]auth.gitBasicAuth::
423+
424If true then Git over HTTP and HTTP/S traffic is authenticated using
425standard BasicAuth and credentials validated using the same auth
426method configured for Gerrit Web UI.
427+
428This parameter only affects git over http traffic. If set to false
429then Gerrit will authenticate through DIGEST authentication and
430the randomly generated HTTP password in Gerrit DB.
431+
432By default this is set to false.
433
Edwin Kempin4b9e5e72011-09-22 15:06:14 +0200434[[auth.userNameToLowerCase]]auth.userNameToLowerCase::
435+
436If set the username that is received to authenticate a git operation
437is converted to lower case for looking up the user account in Gerrit.
438+
439By setting this parameter a case insensitive authentication for the
440git operations can be achieved, if it is ensured that the usernames in
441Gerrit (scheme `username`) are stored in lower case (e.g. if the
442parameter link:#ldap.accountSshUserName[ldap.accountSshUserName] is
443set to `${sAMAccountName.toLowerCase}`). It is important that for all
444existing accounts this username is already in lower case. It is not
445possible to convert the usernames of the existing accounts to lower
446case because this would break the access to existing per-user
447branches.
448+
449This parameter only affects git over http and git over SSH traffic.
450+
451By default this is set to false.
452
Shawn Pearcea931fe12013-06-11 12:29:17 -0700453[[auth.enableRunAs]]auth.enableRunAs::
454+
455If true HTTP REST APIs will accept the `X-Gerrit-RunAs` HTTP request
456header from any users granted the link:access-control.html#capability_runAs[Run As]
457capability. The header and capability permit the authenticated user
458to impersonate another account.
459+
460If false the feature is disabled and cannot be re-enabled without
461editing gerrit.config and restarting the server.
462+
463Default is true.
464
Yuxuan 'fishy' Wang3fba03a2013-12-10 15:08:11 -0800465[[cache]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -0800466=== Section cache
Shawn O. Pearce51967cd2009-05-08 19:46:57 -0700467
Shawn O. Pearce92a7fd12009-08-18 19:52:48 -0700468[[cache.directory]]cache.directory::
Shawn O. Pearce51967cd2009-05-08 19:46:57 -0700469+
470Path to a local directory where Gerrit can write cached entities for
Shawn O. Pearce4b212282009-08-05 19:45:56 -0700471future lookup. This local disk cache is used to retain potentially
472expensive to compute information across restarts. If the location
473does not exist, Gerrit will try to create it.
Shawn O. Pearce51967cd2009-05-08 19:46:57 -0700474+
Shawn O. Pearce4b212282009-08-05 19:45:56 -0700475If not absolute, the path is resolved relative to `$site_path`.
Shawn O. Pearce51967cd2009-05-08 19:46:57 -0700476+
Shawn O. Pearce4b212282009-08-05 19:45:56 -0700477Default is unset, no disk cache.
Shawn O. Pearce51967cd2009-05-08 19:46:57 -0700478
Shawn O. Pearce92a7fd12009-08-18 19:52:48 -0700479[[cache.name.maxAge]]cache.<name>.maxAge::
Shawn O. Pearce51967cd2009-05-08 19:46:57 -0700480+
Shawn O. Pearce2e1cb2b2012-05-24 14:28:40 -0700481Maximum age to keep an entry in the cache. Entries are removed from
482the cache and refreshed from source data every maxAge interval.
Shawn O. Pearced9c403e2009-08-19 08:35:41 -0700483Values should use common unit suffixes to express their setting:
Shawn O. Pearce51967cd2009-05-08 19:46:57 -0700484+
Shawn O. Pearced9c403e2009-08-19 08:35:41 -0700485* s, sec, second, seconds
486* m, min, minute, minutes
487* h, hr, hour, hours
488* d, day, days
489* w, week, weeks (`1 week` is treated as `7 days`)
490* mon, month, months (`1 month` is treated as `30 days`)
491* y, year, years (`1 year` is treated as `365 days`)
492
Shawn O. Pearce302a7dd2009-08-18 19:33:15 -0700493+
Edwin Kempinabcd5042013-03-12 16:04:37 +0100494If a unit suffix is not specified, `seconds` is assumed. If 0 is
Shawn O. Pearce3fdbf392009-09-04 18:08:26 -0700495supplied, the maximum age is infinite and items are never purged
496except when the cache is full.
Shawn O. Pearced9c403e2009-08-19 08:35:41 -0700497+
Shawn O. Pearce2e1cb2b2012-05-24 14:28:40 -0700498Default is `0`, meaning store forever with no expire, except:
Shawn O. Pearced9c403e2009-08-19 08:35:41 -0700499+
Shawn O. Pearce05687e92011-04-04 17:29:03 -0400500* `"adv_bases"`: default is `10 minutes`
Shawn O. Pearced9c403e2009-08-19 08:35:41 -0700501* `"ldap_groups"`: default is `1 hour`
Shawn O. Pearced9c403e2009-08-19 08:35:41 -0700502* `"web_sessions"`: default is `12 hours`
Shawn O. Pearce51967cd2009-05-08 19:46:57 -0700503
Shawn O. Pearce92a7fd12009-08-18 19:52:48 -0700504[[cache.name.memoryLimit]]cache.<name>.memoryLimit::
Shawn O. Pearce51967cd2009-05-08 19:46:57 -0700505+
Shawn O. Pearce2e1cb2b2012-05-24 14:28:40 -0700506The total cost of entries to retain in memory. The cost computation
507varies by the cache. For most caches where the in-memory size of each
508entry is relatively the same, memoryLimit is currently defined to be
509the number of entries held by the cache (each entry costs 1).
510+
511For caches where the size of an entry can vary significantly between
512individual entries (notably `"diff"`, `"diff_intraline"`), memoryLimit
513is an approximation of the total number of bytes stored by the cache.
514Larger entries that represent bigger patch sets or longer source files
515will consume a bigger portion of the memoryLimit. For these caches the
516memoryLimit should be set to roughly the amount of RAM (in bytes) the
517administrator can dedicate to the cache.
Shawn O. Pearce51967cd2009-05-08 19:46:57 -0700518+
Shawn O. Pearceefaf9792009-09-02 18:12:52 -0700519Default is 1024 for most caches, except:
520+
Shawn O. Pearce05687e92011-04-04 17:29:03 -0400521* `"adv_bases"`: default is `4096`
Shawn O. Pearce2e1cb2b2012-05-24 14:28:40 -0700522* `"diff"`: default is `10m` (10 MiB of memory)
523* `"diff_intraline"`: default is `10m` (10 MiB of memory)
524* `"plugin_resources"`: default is 2m (2 MiB of memory)
525
526+
527If set to 0 the cache is disabled. Entries are removed immediately
528after being stored by the cache. This is primarily useful for testing.
Shawn O. Pearce51967cd2009-05-08 19:46:57 -0700529
Shawn O. Pearce92a7fd12009-08-18 19:52:48 -0700530[[cache.name.diskLimit]]cache.<name>.diskLimit::
Shawn O. Pearce51967cd2009-05-08 19:46:57 -0700531+
Shawn O. Pearce2e1cb2b2012-05-24 14:28:40 -0700532Total size in bytes of the keys and values stored on disk. Caches that
533have grown bigger than this size are scanned daily at 1 AM local
534server time to trim the cache. Entries are removed in least recently
535accessed order until the cache fits within this limit. Caches may
536grow larger than this during the day, as the size check is only
537performed once every 24 hours.
Shawn O. Pearce51967cd2009-05-08 19:46:57 -0700538+
Shawn O. Pearce2e1cb2b2012-05-24 14:28:40 -0700539Default is 128 MiB per cache.
Shawn O. Pearce51967cd2009-05-08 19:46:57 -0700540+
Shawn O. Pearce2e1cb2b2012-05-24 14:28:40 -0700541If 0, disk storage for the cache is disabled.
Shawn O. Pearce51967cd2009-05-08 19:46:57 -0700542
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -0800543==== [[cache_names]]Standard Caches
Shawn O. Pearce51967cd2009-05-08 19:46:57 -0700544
Shawn O. Pearce4a452712009-05-28 20:12:33 -0700545cache `"accounts"`::
546+
Shawn O. Pearce4dba9882009-08-05 19:55:15 -0700547Cache entries contain important details of an active user, including
548their display name, preferences, known email addresses, and group
549memberships. Entry information is obtained from the following
550database tables:
551+
552* `accounts`
553+
554* `account_group_members`
555+
556* `account_external_ids`
557
558+
559If direct updates are made to any of these database tables, this
560cache should be flushed.
561
562cache `"accounts_byemail"`::
563+
564Caches account identities keyed by email address, which is scanned
565from the `account_external_ids` database table. If updates are
566made to this table, this cache should be flushed.
Shawn O. Pearce4a452712009-05-28 20:12:33 -0700567
Shawn O. Pearce05687e92011-04-04 17:29:03 -0400568cache `"adv_bases"`::
569+
570Used only for push over smart HTTP when branch level access controls
David Pursehouse92463562013-06-24 10:16:28 +0900571are enabled. The cache entry contains all commits that are available
Shawn O. Pearce05687e92011-04-04 17:29:03 -0400572for the client to use as potential delta bases. Push over smart HTTP
573requires two HTTP requests, and this cache tries to carry state from
574the first request into the second to ensure it can complete.
575
Gustaf Lundh47ce4e32012-05-21 11:18:42 +0200576cache `"changes"`::
577+
Gustaf Lundh3353c362013-04-24 17:25:39 +0200578The size of `memoryLimit` determines the number of projects for which
579all changes will be cached. If the cache is set to 1024, this means all
580changes for up to 1024 projects can be held in the cache.
Gustaf Lundh53493772012-11-18 18:41:15 -0800581+
Gustaf Lundh3353c362013-04-24 17:25:39 +0200582Default value is 0 (disabled). It is disabled by default due to the fact
583that change updates are not communicated between Gerrit servers. Hence
584this cache should be disabled in an multi-master/multi-slave setup.
Gustaf Lundh53493772012-11-18 18:41:15 -0800585+
586The cache should be flushed whenever the database changes table is modified
Matt Baker8ce12fc2013-11-26 21:43:12 -0700587outside of Gerrit.
Gustaf Lundh47ce4e32012-05-21 11:18:42 +0200588
Shawn O. Pearce51967cd2009-05-08 19:46:57 -0700589cache `"diff"`::
590+
Shawn O. Pearceefaf9792009-09-02 18:12:52 -0700591Each item caches the differences between two commits, at both the
592directory and file levels. Gerrit uses this cache to accelerate
593the display of affected file names, as well as file contents.
Shawn O. Pearce51967cd2009-05-08 19:46:57 -0700594+
Shawn O. Pearce2e1cb2b2012-05-24 14:28:40 -0700595Entries in this cache are relatively large, so memoryLimit is an
596estimate in bytes of memory used. Administrators should try to target
597cache.diff.memoryLimit to fit all changes users will view in a 1 or 2
598day span.
Shawn O. Pearce51967cd2009-05-08 19:46:57 -0700599
Shawn O. Pearcef0cfe532011-04-11 23:40:06 -0400600cache `"diff_intraline"`::
601+
602Each item caches the intraline difference of one file, when compared
603between two commits. Gerrit uses this cache to accelerate display of
604intraline differences when viewing a file.
605+
Shawn O. Pearce2e1cb2b2012-05-24 14:28:40 -0700606Entries in this cache are relatively large, so memoryLimit is an
607estimate in bytes of memory used. Administrators should try to target
608cache.diff.memoryLimit to fit all files users will view in a 1 or 2
609day span.
Shawn O. Pearcef0cfe532011-04-11 23:40:06 -0400610
Shawn O. Pearce2d65d292011-06-24 08:12:02 -0700611cache `"git_tags"`::
612+
613If branch or reference level READ access controls are used, this
614cache tracks which tags are reachable from the branch tips of a
615repository. Gerrit uses this information to determine the set
616of tags that a client may access, derived from which tags are
617part of the history of a visible branch.
618+
619The cache is persisted to disk across server restarts as it can
620be expensive to compute (60 or more seconds for a large history
621like the Linux kernel repository).
622
Shawn O. Pearce4a452712009-05-28 20:12:33 -0700623cache `"groups"`::
624+
Shawn O. Pearce4dba9882009-08-05 19:55:15 -0700625Caches the basic group information from the `account_groups` table,
Shawn O. Pearce302a7dd2009-08-18 19:33:15 -0700626including the group owner, name, and description.
627+
628Gerrit group membership obtained from the `account_group_members`
629table is cached under the `"accounts"` cache, above. External group
630membership obtained from LDAP is cached under `"ldap_groups"`.
631
Matt Fischer620255a2011-03-22 14:28:23 -0500632cache `"groups_byinclude"`::
633+
634Caches group inclusions in other groups. If direct updates are made
635to the `account_group_includes` table, this cache should be flushed.
636
Shawn O. Pearce302a7dd2009-08-18 19:33:15 -0700637cache `"ldap_groups"`::
638+
639Caches the LDAP groups that a user belongs to, if LDAP has been
640configured on this server. This cache should be configured with a
641low maxAge setting, to ensure LDAP modifications are picked up in
642a timely fashion.
Shawn O. Pearce4a452712009-05-28 20:12:33 -0700643
Gustaf Lundh0919a492012-10-19 15:29:23 +0200644cache `"ldap_groups_byinclude"`::
645+
646Caches the hierarchical structure of LDAP groups.
647
Shawn O. Pearce6d26f4a2009-08-24 15:43:52 -0700648cache `"ldap_usernames"`::
649+
650Caches a mapping of LDAP username to Gerrit account identity. The
651cache automatically updates when a user first creates their account
652within Gerrit, so the cache expire time is largely irrelevant.
653
Shawn O. Pearce0c1abdb2011-06-24 11:01:25 -0700654cache `"permission_sort"`::
655+
David Pursehouse221d4f62012-06-08 17:38:08 +0900656Caches the order in which access control sections must be applied to a
Shawn O. Pearce0c1abdb2011-06-24 11:01:25 -0700657reference. Sorting the sections can be expensive when regular
658expressions are used, so this cache remembers the ordering for
659each branch.
660
Shawn O. Pearce2e1cb2b2012-05-24 14:28:40 -0700661cache `"plugin_resources"`::
662+
663Caches formatted plugin resources, such as plugin documentation that
664has been converted from Markdown to HTML. The memoryLimit refers to
665the bytes of memory dedicated to storing the documentation.
666
Shawn O. Pearce4a452712009-05-28 20:12:33 -0700667cache `"projects"`::
668+
669Caches the project description records, from the `projects` table
670in the database. If a project record is updated or deleted, this
671cache should be flushed. Newly inserted projects do not require
672a cache flush, as they will be read upon first reference.
673
Shawn O. Pearce51967cd2009-05-08 19:46:57 -0700674cache `"sshkeys"`::
675+
676Caches unpacked versions of user SSH keys, so the internal SSH daemon
677can match against them during authentication. The unit of storage
678is per-user, so 1024 items translates to 1024 unique user accounts.
679As each individual user account may configure multiple SSH keys,
680the total number of keys may be larger than the item count.
Shawn O. Pearce4a452712009-05-28 20:12:33 -0700681+
682This cache is based off the `account_ssh_keys` table and the
683`accounts.ssh_user_name` column in the database. If either is
684modified directly, this cache should be flushed.
Shawn O. Pearce51967cd2009-05-08 19:46:57 -0700685
Shawn O. Pearceb09322b2009-08-15 17:49:00 -0700686cache `"web_sessions"`::
687+
688Tracks the live user sessions coming in over HTTP. Flushing this
689cache would cause all users to be signed out immediately, forcing
Shawn O. Pearce727d80f2009-08-17 07:57:54 -0700690them to sign-in again. To avoid breaking active users, this cache
691is not flushed automatically by `gerrit flush-caches --all`, but
692instead must be explicitly requested.
693+
694If no disk cache is configured (or `cache.web_sessions.diskLimit`
695is set to 0) a server restart will force all users to sign-out,
696and need to sign-in again after the restart, as the cache was
697unable to persist the session information. Enabling a disk cache
698is strongly recommended.
699+
Shawn O. Pearce2e1cb2b2012-05-24 14:28:40 -0700700Session storage is relatively inexpensive. The average entry in
701this cache is approximately 346 bytes.
Shawn O. Pearceb09322b2009-08-15 17:49:00 -0700702
Shawn O. Pearce4016a932009-05-28 15:12:40 -0700703See also link:cmd-flush-caches.html[gerrit flush-caches].
704
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -0800705==== [[cache_options]]Cache Options
Shawn O. Pearce29de4362010-03-03 17:51:26 -0800706
Edwin Kempin42d27432013-11-24 17:06:24 +0100707[[cache.diff_intraline.maxIdleWorkers]]cache.diff_intraline.maxIdleWorkers::
Shawn O. Pearce617aa392010-11-15 14:03:28 -0800708+
709Number of idle worker threads to maintain for the intraline difference
710computations. There is no upper bound on how many concurrent requests
711can occur at once, if additional threads are started to handle a peak
David Pursehouse221d4f62012-06-08 17:38:08 +0900712load, only this many will remain idle afterwards.
Shawn O. Pearce617aa392010-11-15 14:03:28 -0800713+
714Default is 1.5x number of available CPUs.
715
Edwin Kempin42d27432013-11-24 17:06:24 +0100716[[cache.diff_intraline.timeout]]cache.diff_intraline.timeout::
Shawn O. Pearce617aa392010-11-15 14:03:28 -0800717+
718Maximum number of milliseconds to wait for intraline difference data
719before giving up and disabling it for a particular file pair. This is
720a work around for an infinite loop bug in the intraline difference
David Pursehousee8c1fb92013-04-17 17:18:43 +0900721implementation.
722+
723If computation takes longer than the timeout, the worker thread is
724terminated, an error message is shown, and no intraline difference is
725displayed for the file pair.
Shawn O. Pearce617aa392010-11-15 14:03:28 -0800726+
727Values should use common unit suffixes to express their setting:
728+
729* ms, milliseconds
730* s, sec, second, seconds
731* m, min, minute, minutes
732* h, hr, hour, hours
733
734+
735If a unit suffix is not specified, `milliseconds` is assumed.
736+
737Default is 5 seconds.
738
Edwin Kempin42d27432013-11-24 17:06:24 +0100739[[cache.diff_intraline.enabled]]cache.diff_intraline.enabled::
Shawn O. Pearce29de4362010-03-03 17:51:26 -0800740+
741Boolean to enable or disable the computation of intraline differences
Shawn O. Pearce307dd4e2010-11-15 12:12:20 -0800742when populating a diff cache entry. This flag is provided primarily
743as a backdoor to disable the intraline difference feature if
David Pursehouse92463562013-06-24 10:16:28 +0900744necessary. To maintain backwards compatibility with prior versions,
Shawn O. Pearce307dd4e2010-11-15 12:12:20 -0800745this setting will fallback to `cache.diff.intraline` if not set in the
746configuration.
Shawn O. Pearce29de4362010-03-03 17:51:26 -0800747+
748Default is true, enabled.
749
Edwin Kempin42d27432013-11-24 17:06:24 +0100750[[cache.projects.checkFrequency]]cache.projects.checkFrequency::
Shawn O. Pearceb8e4e352011-05-19 18:09:01 -0700751+
752How often project configuration should be checked for update from Git.
753Gerrit Code Review caches project access rules and configuration in
754memory, checking the refs/meta/config branch every checkFrequency
755minutes to see if a new revision should be loaded and used for future
756access. Values can be specified using standard time unit abbreviations
757('ms', 'sec', 'min', etc.).
758+
759If set to 0, checks occur every time, which may slow down operations.
Shawn Pearcec825ef12013-02-20 11:29:46 -0800760If set to 'disabled' or 'off', no check will ever be done.
Shawn O. Pearceb8e4e352011-05-19 18:09:01 -0700761Administrators may force the cache to flush with
762link:cmd-flush-caches.html[gerrit flush-caches].
763+
764Default is 5 minutes.
765
Yuxuan 'fishy' Wang3fba03a2013-12-10 15:08:11 -0800766[[change]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -0800767=== Section change
Shawn Pearceb9ebb662013-07-19 19:45:25 -0700768
Edwin Kempin662e55f2013-11-23 12:50:29 +0100769[[change.largeChange]]change.largeChange::
770+
771Number of changed lines from which on a change is considered as a large
772change. The number of changed lines of a change is the sum of the lines
773that were inserted and deleted in the change.
774+
775The specified value is used to visualize the change sizes in the web UI
776in change tables and user dashboards.
777+
778By default 500.
779
Shawn Pearceb9ebb662013-07-19 19:45:25 -0700780[[change.updateDelay]]change.updateDelay::
781+
782How often in seconds the web interface should poll for updates to the
783currently open change. The poller relies on the client's browser
784cache to use If-Modified-Since and respect `304 Not Modified` HTTP
Matt Baker8ce12fc2013-11-26 21:43:12 -0700785responses. This allows for fast polls, often under 8 milliseconds.
Shawn Pearceb9ebb662013-07-19 19:45:25 -0700786+
787With a configured 30 second delay a server with 4900 active users will
788typically need to dedicate 1 CPU to the update check. 4900 users
789divided by an average delay of 30 seconds is 163 requests arriving per
790second. If requests are served at ~6 ms response time, 1 CPU is
791necessary to keep up with the update request traffic. On a smaller
792user base of 500 active users, the default 30 second delay is only 17
793requests per second and requires ~10% CPU.
794+
795If 0 the update polling is disabled.
796+
797Default is 30 seconds.
798
David Ostrovsky1b61dc72014-01-28 18:40:48 +0100799[[change.allowDrafts]]change.allowDrafts::
800+
801Allow drafts workflow. If set to false, drafts cannot be created,
802deleted or published.
803+
804Default is true.
805
Yuxuan 'fishy' Wang3fba03a2013-12-10 15:08:11 -0800806[[changeMerge]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -0800807=== Section changeMerge
carloseduardo.baldacin14246de2011-07-14 17:52:22 -0300808
Edwin Kempin42d27432013-11-24 17:06:24 +0100809[[changeMerge.checkFrequency]]changeMerge.checkFrequency::
Dave Borowitz204669c22012-10-11 11:06:08 -0700810+
811How often the database should be rescanned for changes that have been
812submitted but not merged due to transient errors. Values can be
813specified using standard time unit abbreviations ('ms', 'sec', 'min',
814etc.). Set to 0 to disable periodic rescanning, only scanning once on
815master node startup.
816+
817Default is 300 seconds (5 minutes).
818
Edwin Kempinf8be8fd2013-11-18 14:12:20 +0100819[[changeMerge.threadPoolSize]]changeMerge.threadPoolSize::
820+
821Maximum size of the thread pool in which the mergeability flag of open
822changes is updated.
823+
824Default is 1.
825
Yuxuan 'fishy' Wang3fba03a2013-12-10 15:08:11 -0800826[[commentlink]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -0800827=== Section commentlink
Yuxuan 'fishy' Wang3fba03a2013-12-10 15:08:11 -0800828
Brad Larson991a31b2009-11-03 14:30:26 -0600829Comment links are find/replace strings applied to change descriptions,
Chris Harris63c7cdd2012-11-23 12:17:36 -0500830patch comments, in-line code comments and approval category value descriptions
831to turn set strings into hyperlinks. One common use is for linking to
832bug-tracking systems.
Brad Larson991a31b2009-11-03 14:30:26 -0600833
834In the following example configuration the 'changeid' comment link
Shawn O. Pearceda866ae2009-12-16 15:46:03 -0800835will match typical Gerrit Change-Id values and create a hyperlink
836to changes which reference it. The second configuration 'bugzilla'
837will hyperlink terms such as 'bug 42' to an external bug tracker,
838supplying the argument record number '42' for display. The third
David Pursehouse221d4f62012-06-08 17:38:08 +0900839configuration 'tracker' uses raw HTML to more precisely control
Shawn O. Pearceda866ae2009-12-16 15:46:03 -0800840how the replacement is displayed to the user.
Brad Larson991a31b2009-11-03 14:30:26 -0600841
Shawn O. Pearceda866ae2009-12-16 15:46:03 -0800842----
843[commentlink "changeid"]
844 match = (I[0-9a-f]{8,40})
845 link = "#q,$1,n,z"
Brad Larson991a31b2009-11-03 14:30:26 -0600846
Shawn O. Pearceda866ae2009-12-16 15:46:03 -0800847[commentlink "bugzilla"]
Shawn O. Pearcec99630a2010-02-21 19:11:56 -0800848 match = "(bug\\s+#?)(\\d+)"
Shawn O. Pearceda866ae2009-12-16 15:46:03 -0800849 link = http://bugs.example.com/show_bug.cgi?id=$2
Brad Larson991a31b2009-11-03 14:30:26 -0600850
Shawn O. Pearceda866ae2009-12-16 15:46:03 -0800851[commentlink "tracker"]
852 match = ([Bb]ug:\\s+)(\\d+)
853 html = $1<a href=\"http://trak.example.com/$2\">$2</a>
854----
855
Dave Borowitz13b38002013-04-08 12:03:29 -0700856Comment links can also be specified in `project.config` and sections in
857children override those in parents. The only restriction is that to
858avoid injecting arbitrary user-supplied HTML in the page, comment links
859defined in `project.config` may only supply `link`, not `html`.
860
Shawn O. Pearceda866ae2009-12-16 15:46:03 -0800861[[commentlink.name.match]]commentlink.<name>.match::
Brad Larson991a31b2009-11-03 14:30:26 -0600862+
Shawn O. Pearceda866ae2009-12-16 15:46:03 -0800863A JavaScript regular expression to match positions to be replaced
864with a hyperlink. Subexpressions of the matched string can be
865stored using groups and accessed with `$'n'` syntax, where 'n'
866is the group number, starting from 1.
Brad Larson991a31b2009-11-03 14:30:26 -0600867+
Shawn O. Pearcec99630a2010-02-21 19:11:56 -0800868The configuration file parser eats one level of backslashes, so the
869character class `\s` requires `\\s` in the configuration file. The
870parser also terminates the line at the first `#`, so a match
871expression containing # must be wrapped in double quotes.
Shawn O. Pearceda866ae2009-12-16 15:46:03 -0800872+
Shawn O. Pearce665beaa2010-02-21 22:41:03 -0800873To match case insensitive strings, a character class with both the
874upper and lower case character for each position must be used. For
875example, to match the string `bug` in a case insensitive way the match
876pattern `[bB][uU][gG]` needs to be used.
877+
Shawn O. Pearceda866ae2009-12-16 15:46:03 -0800878A common pattern to match is `bug\\s+(\\d+)`.
Brad Larson991a31b2009-11-03 14:30:26 -0600879
Shawn O. Pearceda866ae2009-12-16 15:46:03 -0800880[[commentlink.name.link]]commentlink.<name>.link::
Brad Larson991a31b2009-11-03 14:30:26 -0600881+
Shawn O. Pearceda866ae2009-12-16 15:46:03 -0800882The URL to direct the user to whenever the regular expression is
883matched. Groups in the match expression may be accessed as `$'n'`.
884+
885The link property is used only when the html property is not present.
886
887[[commentlink.name.html]]commentlink.<name>.html::
888+
889HTML to replace the entire matched string with. If present,
890this property overrides the link property above. Groups in the
891match expression may be accessed as `$'n'`.
892+
893The configuration file eats double quotes, so escaping them as
894`\"` is necessary to protect them from the parser.
Brad Larson991a31b2009-11-03 14:30:26 -0600895
Dave Borowitz82d79c02013-04-08 15:45:12 -0700896[[commentlink.name.enabled]]commentlink.<name>.enabled::
897+
898Whether the comment link is enabled. A child project may override a
899section in a parent or the site-wide config that is disabled by
900specifying `enabled = true`.
901+
902Disabling sections in `gerrit.config` can be used by site administrators
903to create a library of comment links with `html` set that are not
904user-supplied and thus can be verified to be XSS-free, but are only
905enabled for a subset of projects.
906+
David Pursehouse6f1af472013-12-11 19:23:33 +0900907By default, true.
908+
Dave Borowitz82d79c02013-04-08 15:45:12 -0700909Note that the names and contents of disabled sections are visible even
910to anonymous users via the
911link:rest-api-projects.html#get-config[REST API].
912
Brad Larson991a31b2009-11-03 14:30:26 -0600913
Yuxuan 'fishy' Wang3fba03a2013-12-10 15:08:11 -0800914[[contactstore]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -0800915=== Section contactstore
Shawn O. Pearce6854bdc2009-06-01 08:14:15 -0700916
Shawn O. Pearce92a7fd12009-08-18 19:52:48 -0700917[[contactstore.url]]contactstore.url::
Shawn O. Pearce6854bdc2009-06-01 08:14:15 -0700918+
919URL of the web based contact store Gerrit will send any offline
920contact information to when it collects the data from users as part
921of a contributor agreement.
922+
923See link:config-contact.html[Contact Information].
924
Shawn O. Pearce92a7fd12009-08-18 19:52:48 -0700925[[contactstore.appsec]]contactstore.appsec::
Shawn O. Pearce6854bdc2009-06-01 08:14:15 -0700926+
927Shared secret of the web based contact store.
928
Shawn O. Pearcee24c71fb2009-12-07 20:32:40 -0800929
Yuxuan 'fishy' Wang3fba03a2013-12-10 15:08:11 -0800930[[container]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -0800931=== Section container
Shawn O. Pearcee24c71fb2009-12-07 20:32:40 -0800932
933These settings are applied only if Gerrit is started as the container
934process through Gerrit's 'gerrit.sh' rc.d compatible wrapper script.
935
936[[container.heapLimit]]container.heapLimit::
937+
938Maximum heap size of the Java process running Gerrit, in bytes.
939This property is translated into the '-Xmx' flag for the JVM.
940+
941Default is platform and JVM specific.
942+
943Common unit suffixes of 'k', 'm', or 'g' are supported.
944
945[[container.javaHome]]container.javaHome::
946+
947Path of the JRE/JDK installation to run Gerrit with. If not set, the
948Gerrit startup script will attempt to search your system and guess
949a suitable JRE. Overrides the environment variable 'JAVA_HOME'.
950
951[[container.javaOptions]]container.javaOptions::
952+
953Additional options to pass along to the Java runtime. If multiple
954values are configured, they are passed in order on the command line,
955separated by spaces. These options are appended onto 'JAVA_OPTIONS'.
956
David Ostrovskyc772bd82013-10-03 10:37:51 +0200957For example, it is possible to overwrite Gerrit's default log4j
958configuration:
959
960----
961 javaOptions = -Dlog4j.configuration=file:///home/gerrit/site/etc/log4j.properties
962----
963
Fredrik Luthanderb8f7d6d2010-05-18 21:11:22 +0200964[[container.slave]]container.slave::
965+
966Used on Gerrit slave installations. If set to true the Gerrit JVM is
967called with the '--slave' switch, enabling slave mode. If no value is
Matt Baker8ce12fc2013-11-26 21:43:12 -0700968set (or any other value), Gerrit defaults to master mode.
Fredrik Luthanderb8f7d6d2010-05-18 21:11:22 +0200969
Shawn O. Pearcee24c71fb2009-12-07 20:32:40 -0800970[[container.user]]container.user::
971+
972Login name (or UID) of the operating system user the Gerrit JVM
973will execute as. If not set, defaults to the user who launched
974the 'gerrit.sh' wrapper script.
975
976[[container.war]]container.war::
977+
978Path of the JAR file to start daemon execution with. This should
979be the path of the local 'gerrit.war' archive. Overrides the
980environment variable 'GERRIT_WAR'.
981+
982If not set, defaults to '$site_path/bin/gerrit.war', or to
983'$HOME/gerrit.war'.
984
985
Yuxuan 'fishy' Wang3fba03a2013-12-10 15:08:11 -0800986[[core]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -0800987=== Section core
Shawn O. Pearce6854bdc2009-06-01 08:14:15 -0700988
Shawn O. Pearce92a7fd12009-08-18 19:52:48 -0700989[[core.packedGitWindowSize]]core.packedGitWindowSize::
Shawn O. Pearce6854bdc2009-06-01 08:14:15 -0700990+
991Number of bytes of a pack file to load into memory in a single
992read operation. This is the "page size" of the JGit buffer cache,
993used for all pack access operations. All disk IO occurs as single
994window reads. Setting this too large may cause the process to load
995more data than is required; setting this too small may increase
996the frequency of `read()` system calls.
997+
998Default on JGit is 8 KiB on all platforms.
999+
1000Common unit suffixes of 'k', 'm', or 'g' are supported.
1001
Shawn O. Pearce92a7fd12009-08-18 19:52:48 -07001002[[core.packedGitLimit]]core.packedGitLimit::
Shawn O. Pearce6854bdc2009-06-01 08:14:15 -07001003+
1004Maximum number of bytes to load and cache in memory from pack files.
1005If JGit needs to access more than this many bytes it will unload less
1006frequently used windows to reclaim memory space within the process.
1007As this buffer must be shared with the rest of the JVM heap, it
1008should be a fraction of the total memory available.
1009+
1010Default on JGit is 10 MiB on all platforms.
1011+
1012Common unit suffixes of 'k', 'm', or 'g' are supported.
1013
Shawn O. Pearce92a7fd12009-08-18 19:52:48 -07001014[[core.deltaBaseCaseLimit]]core.deltaBaseCacheLimit::
Shawn O. Pearce6854bdc2009-06-01 08:14:15 -07001015+
1016Maximum number of bytes to reserve for caching base objects
1017that multiple deltafied objects reference. By storing the entire
1018decompressed base object in a cache Git is able to avoid unpacking
1019and decompressing frequently used base objects multiple times.
1020+
1021Default on JGit is 10 MiB on all platforms. You probably do not
1022need to adjust this value.
1023+
1024Common unit suffixes of 'k', 'm', or 'g' are supported.
1025
Shawn O. Pearce92a7fd12009-08-18 19:52:48 -07001026[[core.packedGitOpenFiles]]core.packedGitOpenFiles::
Shawn O. Pearce6854bdc2009-06-01 08:14:15 -07001027+
1028Maximum number of pack files to have open at once. A pack file
1029must be opened in order for any of its data to be available in
1030a cached window.
1031+
1032If you increase this to a larger setting you may need to also adjust
1033the ulimit on file descriptors for the host JVM, as Gerrit needs
1034additional file descriptors available for network sockets and other
1035repository data manipulation.
1036+
1037Default on JGit is 128 file descriptors on all platforms.
1038
Shawn O. Pearce329fe792010-09-03 15:44:23 -07001039[[core.streamFileThreshold]]core.streamFileThreshold::
1040+
1041Largest object size, in bytes, that JGit will allocate as a
1042contiguous byte array. Any file revision larger than this threshold
1043will have to be streamed, typically requiring the use of temporary
David Pursehouse92463562013-06-24 10:16:28 +09001044files under '$GIT_DIR/objects' to implement pseudo-random access
Shawn O. Pearce329fe792010-09-03 15:44:23 -07001045during delta decompression.
1046+
1047Servers with very high traffic should set this to be larger than
1048the size of their common big files. For example a server managing
1049the Android platform typically has to deal with ~10-12 MiB XML
1050files, so `15 m` would be a reasonable setting in that environment.
1051Setting this too high may cause the JVM to run out of heap space
1052when handling very big binary files, such as device firmware or
1053CD-ROM ISO images.
1054+
Shawn O. Pearcee3febd92010-10-13 21:17:53 -07001055Default is 50 MiB on all platforms. Prior to Gerrit 2.1.6,
Shawn O. Pearce329fe792010-09-03 15:44:23 -07001056this value was effectively 2047 MiB.
1057+
1058Common unit suffixes of 'k', 'm', or 'g' are supported.
1059
Shawn O. Pearce92a7fd12009-08-18 19:52:48 -07001060[[core.packedGitMmap]]core.packedGitMmap::
Shawn O. Pearce6854bdc2009-06-01 08:14:15 -07001061+
1062When true, JGit will use `mmap()` rather than `malloc()+read()`
1063to load data from pack files. The use of mmap can be problematic
1064on some JVMs as the garbage collector must deduce that a memory
1065mapped segment is no longer in use before a call to `munmap()`
1066can be made by the JVM native code.
1067+
1068In server applications (such as Gerrit) that need to access many
David Pursehouse92463562013-06-24 10:16:28 +09001069pack files, setting this to true risks artificially running out
Shawn O. Pearce6854bdc2009-06-01 08:14:15 -07001070of virtual address space, as the garbage collector cannot reclaim
1071unused mapped spaces fast enough.
1072+
1073Default on JGit is false. Although potentially slower, it yields
1074much more predictable behavior.
1075
Sasa Zivkovf69aeb12012-06-11 14:05:14 +02001076[[core.asyncLoggingBufferSize]]core.asyncLoggingBufferSize::
1077+
1078Size of the buffer to store logging events for asynchronous logging.
1079Putting a larger value can protect threads from stalling when the
1080AsyncAppender threads are not fast enough to consume the logging events
1081from the buffer. It also protects from loosing log entries in this case.
1082+
1083Default is 64 entries.
1084
Dave Borowitz1bec65a2013-03-13 10:59:01 -07001085[[core.useRecursiveMerge]]core.useRecursiveMerge::
1086+
1087Use JGit's new, experimental recursive merger for three-way merges.
1088This only affects projects configured to automatically resolve
1089conflicts.
1090+
1091Default is false, but in a future release may default to true.
1092
Yuxuan 'fishy' Wang3fba03a2013-12-10 15:08:11 -08001093[[database]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08001094=== Section database
Shawn O. Pearcefb5548e2009-11-11 07:39:21 -08001095
1096The database section configures where Gerrit stores its metadata
1097records about user accounts and change reviews.
1098
Shawn O. Pearce9d342a42009-12-16 15:49:05 -08001099----
1100[database]
Shawn O. Pearce1be39062009-12-19 14:11:52 -08001101 type = POSTGRESQL
Shawn O. Pearce9d342a42009-12-16 15:49:05 -08001102 hostname = localhost
1103 database = reviewdb
1104 username = gerrit2
1105 password = s3kr3t
1106----
Shawn O. Pearcefb5548e2009-11-11 07:39:21 -08001107
1108[[database.type]]database.type::
1109+
1110Type of database server to connect to. If set this value will be
1111used to automatically create correct database.driver and database.url
1112values to open the connection.
1113+
Shawn O. Pearce1be39062009-12-19 14:11:52 -08001114* `POSTGRESQL`
Shawn O. Pearcefb5548e2009-11-11 07:39:21 -08001115+
1116Connect to a PostgreSQL database server.
1117+
1118* `H2`
1119+
Shawn O. Pearce1be39062009-12-19 14:11:52 -08001120Connect to a local embedded H2 database.
Shawn O. Pearcefb5548e2009-11-11 07:39:21 -08001121+
Shawn O. Pearce1be39062009-12-19 14:11:52 -08001122* `MYSQL`
Shawn O. Pearcefb5548e2009-11-11 07:39:21 -08001123+
1124Connect to a MySQL database server.
Shawn O. Pearce1be39062009-12-19 14:11:52 -08001125+
1126* `JDBC`
1127+
1128Connect using a JDBC driver class name and URL.
Shawn O. Pearcefb5548e2009-11-11 07:39:21 -08001129
1130+
1131If not specified, database.driver and database.url are used as-is,
1132and if they are also not specified, defaults to H2.
1133
1134[[database.hostname]]database.hostname::
1135+
1136Hostname of the database server. Defaults to 'localhost'.
1137
1138[[database.port]]database.port::
1139+
1140Port number of the database server. Defaults to the default port
1141of the server named by database.type.
1142
1143[[database.database]]database.database::
1144+
Shawn O. Pearce1be39062009-12-19 14:11:52 -08001145For POSTGRESQL or MYSQL, the name of the database on the server.
Shawn O. Pearcefb5548e2009-11-11 07:39:21 -08001146+
1147For H2, this is the path to the database, and if not absolute is
Shawn O. Pearce1be39062009-12-19 14:11:52 -08001148relative to `'$site_path'`.
Shawn O. Pearcefb5548e2009-11-11 07:39:21 -08001149
1150[[database.username]]database.username::
1151+
1152Username to connect to the database server as.
1153
1154[[database.password]]database.password::
1155+
1156Password to authenticate to the database server with.
1157
1158[[database.driver]]database.driver::
1159+
Shawn O. Pearce1be39062009-12-19 14:11:52 -08001160Name of the JDBC driver class to connect to the database with.
1161Setting this usually isn't necessary as it can be derived from
1162database.type or database.url for any supported database.
Shawn O. Pearcefb5548e2009-11-11 07:39:21 -08001163
1164[[database.url]]database.url::
1165+
Shawn O. Pearce1be39062009-12-19 14:11:52 -08001166'jdbc:' URL for the database. Setting this variable usually
1167isn't necessary as it can be constructed from the all of the
1168above properties.
Shawn O. Pearcefb5548e2009-11-11 07:39:21 -08001169
Christian Aistleitner851072a2013-05-05 15:04:09 +02001170[[database.connectionPool]]database.connectionPool::
1171+
1172If true, use connection pooling for database connections. Otherwise, a
1173new database connection is opened for each request.
1174+
1175Default is false for MySQL, and true for other database backends.
1176
Shawn O. Pearce07f35177d2010-02-23 09:47:10 -08001177[[database.poolLimit]]database.poolLimit::
1178+
1179Maximum number of open database connections. If the server needs
1180more than this number, request processing threads will wait up
1181to <<database.poolMaxWait, poolMaxWait>> seconds for a
1182connection to be released before they abort with an exception.
1183This limit must be several units higher than the total number of
1184httpd and sshd threads as some request processing code paths may
1185need multiple connections.
1186+
1187Default is 8.
Christian Aistleitner851072a2013-05-05 15:04:09 +02001188+
1189This setting only applies if
1190<<database.connectionPool,database.connectionPool>> is true.
Shawn O. Pearce07f35177d2010-02-23 09:47:10 -08001191
Shawn O. Pearcef458bf62010-02-25 09:03:03 -08001192[[database.poolMinIdle]]database.poolMinIdle::
Shawn O. Pearce07f35177d2010-02-23 09:47:10 -08001193+
1194Minimum number of connections to keep idle in the pool.
1195Default is 4.
Christian Aistleitner851072a2013-05-05 15:04:09 +02001196+
1197This setting only applies if
1198<<database.connectionPool,database.connectionPool>> is true.
Shawn O. Pearce07f35177d2010-02-23 09:47:10 -08001199
Shawn O. Pearcef458bf62010-02-25 09:03:03 -08001200[[database.poolMaxIdle]]database.poolMaxIdle::
Shawn O. Pearce07f35177d2010-02-23 09:47:10 -08001201+
1202Maximum number of connections to keep idle in the pool. If there
1203are more idle connections, connections will be closed instead of
1204being returned back to the pool.
1205Default is 4.
Christian Aistleitner851072a2013-05-05 15:04:09 +02001206+
1207This setting only applies if
1208<<database.connectionPool,database.connectionPool>> is true.
Shawn O. Pearce07f35177d2010-02-23 09:47:10 -08001209
1210[[database.poolMaxWait]]database.poolMaxWait::
1211+
1212Maximum amount of time a request processing thread will wait to
1213acquire a database connection from the pool. If no connection is
1214released within this time period, the processing thread will abort
1215its current operations and return an error to the client.
1216Values should use common unit suffixes to express their setting:
1217+
1218* ms, milliseconds
1219* s, sec, second, seconds
1220* m, min, minute, minutes
1221* h, hr, hour, hours
1222
1223+
1224If a unit suffix is not specified, `milliseconds` is assumed.
1225+
1226Default is `30 seconds`.
Christian Aistleitner851072a2013-05-05 15:04:09 +02001227+
1228This setting only applies if
1229<<database.connectionPool,database.connectionPool>> is true.
Shawn O. Pearce07f35177d2010-02-23 09:47:10 -08001230
David Ostrovsky38a6f6c2014-01-11 13:56:09 +01001231[[database.dataSourceInterceptorClass]]database.dataSourceInterceptorClass::
1232
1233Class that implements DataSourceInterceptor interface to monitor SQL activity.
1234This class must have default constructor and be available on Gerrit's bootstrap
1235classpath, e. g. in `$gerrit_site/lib` directory. Example implementation of
1236SQL monitoring can be found in javamelody-plugin.
1237
Yuxuan 'fishy' Wang3fba03a2013-12-10 15:08:11 -08001238[[download]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08001239=== Section download
monica.dionisio3f630442010-06-29 15:42:57 -03001240
1241----
1242[download]
Edwin Kempin08b03a22012-09-14 16:32:57 +02001243 command = checkout
1244 command = cherry_pick
1245 command = pull
1246 command = format_patch
monica.dionisio3f630442010-06-29 15:42:57 -03001247 scheme = ssh
1248 scheme = http
1249 scheme = anon_http
1250 scheme = anon_git
1251 scheme = repo_download
1252----
1253
1254The download section configures the allowed download methods.
1255
Edwin Kempin08b03a22012-09-14 16:32:57 +02001256[[download.command]]download.command::
1257+
1258Commands that should be offered to download changes.
1259+
1260Multiple commands are supported:
1261+
1262* `checkout`
1263+
1264Command to fetch and checkout the patch set.
1265+
1266* `cherry_pick`
1267+
1268Command to fetch the patch set and to cherry-pick it onto the current
1269commit.
1270+
1271* `pull`
1272+
1273Command to pull the patch set.
1274+
1275* `format_patch`
1276+
1277Command to fetch the patch set and to feed it into the `format-patch`
1278command.
1279
1280+
1281If `download.command` is not specified, all download commands are
1282offered.
1283
monica.dionisio3f630442010-06-29 15:42:57 -03001284[[download.scheme]]download.scheme::
1285+
1286Schemes that should be used to download changes.
1287+
1288Multiple schemes are supported:
1289+
1290* `http`
1291+
Shawn O. Pearce5c46a072010-08-23 08:33:32 -07001292Authenticated HTTP download is allowed.
monica.dionisio3f630442010-06-29 15:42:57 -03001293+
1294* `ssh`
1295+
Shawn O. Pearce5c46a072010-08-23 08:33:32 -07001296Authenticated SSH download is allowed.
monica.dionisio3f630442010-06-29 15:42:57 -03001297+
1298* `anon_http`
1299+
1300Anonymous HTTP download is allowed.
1301+
1302* `anon_git`
1303+
Shawn O. Pearce5c46a072010-08-23 08:33:32 -07001304Anonymous Git download is allowed. This is not default, it is also
1305necessary to set <<gerrit.canonicalGitUrl,gerrit.canonicalGitUrl>>
1306variable.
monica.dionisio3f630442010-06-29 15:42:57 -03001307+
1308* `repo_download`
1309+
Shawn O. Pearce5c46a072010-08-23 08:33:32 -07001310Gerrit advertises patch set downloads with the `repo download`
1311command, assuming that all projects managed by this instance are
1312generally worked on with the repo multi-repository tool. This is
1313not default, as not all instances will deploy repo.
monica.dionisio3f630442010-06-29 15:42:57 -03001314
1315+
Edwin Kempin08b03a22012-09-14 16:32:57 +02001316If `download.scheme` is not specified, SSH, HTTP and Anonymous HTTP
Shawn O. Pearce5c46a072010-08-23 08:33:32 -07001317downloads are allowed.
Shawn O. Pearcefb5548e2009-11-11 07:39:21 -08001318
Yuxuan 'fishy' Wang3fba03a2013-12-10 15:08:11 -08001319[[gerrit]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08001320=== Section gerrit
Shawn O. Pearceeb7f8ce2009-06-01 09:57:15 -07001321
Shawn O. Pearce92a7fd12009-08-18 19:52:48 -07001322[[gerrit.basePath]]gerrit.basePath::
Shawn O. Pearce9743d0b2009-06-01 10:10:06 -07001323+
1324Local filesystem directory holding all Git repositories that
1325Gerrit knows about and can process changes for. A project
1326entity in Gerrit maps to a local Git repository by creating
Edwin Kempincdb0e002011-09-08 14:23:30 +02001327the path string `"${basePath}/${project_name}.git"`.
Shawn O. Pearce9743d0b2009-06-01 10:10:06 -07001328+
1329If relative, the path is resolved relative to `'$site_path'`.
1330
Shawn O. Pearce897d9212011-06-16 16:59:59 -07001331[[gerrit.allProjects]]gerrit.allProjects::
1332+
1333Name of the permissions-only project defining global server
1334access controls and settings. These are inherited into every
1335other project managed by the running server. The name is
1336relative to `gerrit.basePath`.
1337+
1338Defaults to `All-Projects` if not set.
1339
Shawn O. Pearce92a7fd12009-08-18 19:52:48 -07001340[[gerrit.canonicalWebUrl]]gerrit.canonicalWebUrl::
Shawn O. Pearceeb7f8ce2009-06-01 09:57:15 -07001341+
1342The default URL for Gerrit to be accessed through.
1343+
1344Typically this would be set to "http://review.example.com/" or
1345"http://example.com/gerrit/" so Gerrit can output links that point
1346back to itself.
1347+
1348Setting this is highly recommended, as its necessary for the upload
1349code invoked by "git push" or "repo upload" to output hyperlinks
1350to the newly uploaded changes.
1351
Shawn O. Pearce92a7fd12009-08-18 19:52:48 -07001352[[gerrit.canonicalGitUrl]]gerrit.canonicalGitUrl::
Shawn O. Pearceeb7f8ce2009-06-01 09:57:15 -07001353+
1354Optional base URL for repositories available over the anonymous git
1355protocol. For example, set this to `git://mirror.example.com/base/`
1356to have Gerrit display patch set download URLs in the UI. Gerrit
1357automatically appends the project name onto the end of the URL.
1358+
1359By default unset, as the git daemon must be configured externally
1360by the system administrator, and might not even be running on the
1361same host as Gerrit.
1362
Dave Borowitz76ab1a12013-05-10 17:01:29 +01001363[[gerrit.installCommitMsgHookCommand]]gerrit.installCommitMsgHookCommand::
1364+
1365Optional command to install the `commit-msg` hook. Typically of the
1366form:
1367----
1368fetch-cmd some://url/to/commit-msg .git/hooks/commit-msg ; chmod +x .git/hooks/commit-msg
1369----
Shawn Pearce6d731f52013-09-24 12:13:50 -07001370
Dave Borowitz76ab1a12013-05-10 17:01:29 +01001371+
1372By default unset; falls back to using scp from the canonical SSH host,
1373or curl from the canonical HTTP URL for the server. Only necessary if a
1374proxy or other server/network configuration prevents clients from
1375fetching from the default location.
1376
Shawn O. Pearce5d6de522011-10-07 18:00:16 -07001377[[gerrit.gitHttpUrl]]gerrit.gitHttpUrl::
1378+
1379Optional base URL for repositories available over the HTTP
1380protocol. For example, set this to `http://mirror.example.com/base/`
1381to have Gerrit display URLs from this server, rather than itself.
1382+
1383By default unset, as the HTTP daemon must be configured externally
1384by the system administrator, and might not even be running on the
1385same host as Gerrit.
1386
Shawn O. Pearceb8bea1b2012-08-16 17:18:58 -07001387[[gerrit.reportBugUrl]]gerrit.reportBugUrl::
1388+
1389URL to direct users to when they need to report a bug about the
1390Gerrit service. By default this links to the upstream Gerrit
1391Code Review's own bug tracker but could be directed to the system
1392administrator's ticket queue.
1393
David Pursehouse753ca332013-12-10 15:36:29 +09001394[[gerrit.reportBugText]]gerrit.reportBugText::
1395+
1396Text to be displayed in the link to the bug report URL.
1397+
1398Defaults to "Report Bug".
1399
Shawn Pearce6d731f52013-09-24 12:13:50 -07001400[[gerrit.changeScreen]]gerrit.changeScreen::
1401+
1402Default change screen UI to direct users to. Valid values are
David Ostrovskybbb688e2013-11-09 12:10:19 +01001403`OLD_UI` and `CHANGE_SCREEN2`. Default is `CHANGE_SCREEN2`.
Shawn Pearce6d731f52013-09-24 12:13:50 -07001404
Yuxuan 'fishy' Wang3fba03a2013-12-10 15:08:11 -08001405[[gitweb]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08001406=== Section gitweb
Shawn O. Pearced7ba11f2009-06-01 09:35:41 -07001407
Shawn O. Pearce618dae22010-03-12 19:07:43 -08001408Gerrit can forward requests to either an internally managed gitweb
1409(which allows Gerrit to enforce some access controls), or to an
1410externally managed gitweb (where the web server manages access).
Shawn O. Pearced7ba11f2009-06-01 09:35:41 -07001411See also link:config-gitweb.html[Gitweb Integration].
1412
Shawn O. Pearce618dae22010-03-12 19:07:43 -08001413[[gitweb.cgi]]gitweb.cgi::
1414+
1415Path to the locally installed `gitweb.cgi` executable. This CGI will
1416be called by Gerrit Code Review when the URL `/gitweb` is accessed.
1417Project level access controls are enforced prior to calling the CGI.
1418+
1419Defaults to `/usr/lib/cgi-bin/gitweb.cgi` if gitweb.url is not set.
1420
Shawn O. Pearce92a7fd12009-08-18 19:52:48 -07001421[[gitweb.url]]gitweb.url::
Shawn O. Pearced7ba11f2009-06-01 09:35:41 -07001422+
1423Optional URL of an affiliated gitweb service. Defines the
1424web location where a `gitweb.cgi` is installed to browse
Shawn O. Pearce9743d0b2009-06-01 10:10:06 -07001425gerrit.basePath and the repositories it contains.
Shawn O. Pearced7ba11f2009-06-01 09:35:41 -07001426+
1427Gerrit appends any necessary query arguments onto the end of this URL.
1428For example, "?p=$project.git;h=$commit".
1429
Shane Mc Cormack27868a42009-12-28 04:49:39 +00001430[[gitweb.type]]gitweb.type::
1431+
1432Optional type of affiliated gitweb service. This allows using
Shawn O. Pearce2b11da02011-09-06 16:18:12 -07001433alternatives to gitweb, such as cgit. If set to disabled there
1434is no gitweb hyperlinking support.
Shane Mc Cormack27868a42009-12-28 04:49:39 +00001435+
Shawn O. Pearce2b11da02011-09-06 16:18:12 -07001436Valid values are `gitweb`, `cgit`, `disabled` or `custom`.
Shane Mc Cormack27868a42009-12-28 04:49:39 +00001437
Edwin Kempind86909c2012-03-26 10:36:29 +02001438[[gitweb.revision]]gitweb.revision::
Shane Mc Cormack27868a42009-12-28 04:49:39 +00001439+
1440Optional pattern to use for constructing the gitweb URL when pointing
1441at a specific commit when `custom` is used above.
1442+
Edwin Kempincdb0e002011-09-08 14:23:30 +02001443Valid replacements are `${project}` for the project name in Gerrit
1444and `${commit}` for the SHA1 hash for the commit.
Shane Mc Cormack27868a42009-12-28 04:49:39 +00001445
Edwin Kempind86909c2012-03-26 10:36:29 +02001446[[gitweb.project]]gitweb.project::
Shane Mc Cormack27868a42009-12-28 04:49:39 +00001447+
1448Optional pattern to use for constructing the gitweb URL when pointing
1449at a specific project when `custom` is used above.
1450+
Edwin Kempincdb0e002011-09-08 14:23:30 +02001451Valid replacements are `${project}` for the project name in Gerrit.
Shane Mc Cormack27868a42009-12-28 04:49:39 +00001452
Edwin Kempind86909c2012-03-26 10:36:29 +02001453[[gitweb.branch]]gitweb.branch::
Shane Mc Cormack27868a42009-12-28 04:49:39 +00001454+
1455Optional pattern to use for constructing the gitweb URL when pointing
1456at a specific branch when `custom` is used above.
1457+
Edwin Kempincdb0e002011-09-08 14:23:30 +02001458Valid replacements are `${project}` for the project name in Gerrit
1459and `${branch}` for the name of the branch.
Shane Mc Cormack27868a42009-12-28 04:49:39 +00001460
Colby Ranger79d4ebe2013-12-16 14:19:18 -08001461[[gitweb.roottree]]gitweb.roottree::
1462+
1463Optional pattern to use for constructing the gitweb URL when pointing
1464at the contents of the root tree in a specific commit when `custom` is
1465used above.
1466+
1467Valid replacements are `${project}` for the project name in Gerrit
1468and `${commit}` for the SHA1 hash for the commit.
1469
1470[[gitweb.file]]gitweb.file::
1471+
1472Optional pattern to use for constructing the gitweb URL when pointing
1473at the contents of a file in a specific commit when `custom` is used
1474above.
1475+
1476Valid replacements are `${project}` for the project name in Gerrit,
1477`${file}` for the file name and `${commit}` for the SHA1 hash for
1478the commit.
1479
Edwin Kempin64011562012-03-26 10:50:12 +02001480[[gitweb.filehistory]]gitweb.filehistory::
1481+
1482Optional pattern to use for constructing the gitweb URL when pointing
1483at the history of a file in a specific branch when `custom` is used
1484above.
1485+
1486Valid replacements are `${project}` for the project name in Gerrit,
1487`${file}` for the file name and `${branch}` for the name of the
1488branch.
1489
Gustaf Lundha07d2e72011-10-27 15:26:35 -07001490[[gitweb.linkname]]gitweb.linkname::
1491+
1492Optional setting for modifying the link name presented to the user
1493in the Gerrit web-UI.
1494+
1495Default linkname for custom type is "gitweb".
Shawn O. Pearce302a7dd2009-08-18 19:33:15 -07001496
Adrian Goerlerf2007072011-11-10 08:39:55 +01001497[[gitweb.pathSeparator]]gitweb.pathSeparator::
1498+
1499Optional character to substitute the standard path separator (slash) in
1500project names and branch names.
1501+
1502By default, Gerrit will use hexadecimal encoding for slashes in project and
1503branch names. Some web servers, such as Tomcat, reject this hexadecimal
1504encoding in the URL.
1505+
1506Some alternative gitweb services, such as link:http://gitblit.com[Gitblit],
1507allow using an alternative path separator character. In Gitblit, this can be
1508configured through the property link:http://gitblit.com/properties.html[web.forwardSlashCharacter].
1509In Gerrit, the alternative path separator can be configured correspondingly
1510using the property 'gitweb.pathSeparator'.
1511+
1512Valid values are the characters '*', '(' and ')'.
1513
Luca Milanesio25312032013-10-11 11:34:39 +01001514[[gitweb.linkDrafts]]gitweb.urlEncode::
1515+
1516Whether or not Gerrit should encode the generated viewer URL.
1517+
1518Gerrit composes the viewer URL using information about the project, branch, file
1519or commit of the target object to be displayed. Typically viewers such as CGit
1520and GitWeb do need those parts to be encoded, including the '/' in project's name,
1521for being correctly parsed.
1522However other viewers could instead require an unencoded URL (e.g. GitHub web
1523based viewer)
1524+
1525Valid values are "true" and "false," default is "true."
1526
Chad Horohoe1dfe36c2013-04-12 14:52:56 -04001527[[gitweb.linkDrafts]]gitweb.linkDrafts::
1528+
1529Whether or not Gerrit should provide links to gitweb on draft patch sets.
1530+
1531By default, Gerrit will show links to gitweb on all patch sets. If gitweb
1532only allows publicly viewable references, set this to false to remove
1533the links to draft patch sets from the change review screen.
1534+
Luca Milanesio25312032013-10-11 11:34:39 +01001535Valid values are "true" and "false," default is "true".
Chad Horohoe1dfe36c2013-04-12 14:52:56 -04001536
Yuxuan 'fishy' Wang3fba03a2013-12-10 15:08:11 -08001537[[groups]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08001538=== Section groups
Edwin Kempin4bbff702013-01-11 09:59:53 +01001539
1540[[groups.newGroupsVisibleToAll]]groups.newGroupsVisibleToAll::
1541+
1542Controls whether newly created groups should be by default visible to
1543all registered users.
1544+
1545By default, false.
1546
Yuxuan 'fishy' Wang3fba03a2013-12-10 15:08:11 -08001547[[hooks]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08001548=== Section hooks
Shane Mc Cormack6c2b6772010-01-12 21:56:44 +00001549
1550See also link:config-hooks.html[Hooks].
1551
1552[[hooks.path]]hooks.path::
1553+
1554Optional path to hooks, if not specified then `'$site_path'/hooks` will be used.
1555
1556[[hooks.patchsetCreatedHook]]hooks.patchsetCreatedHook::
1557+
1558Optional filename for the patchset created hook, if not specified then
1559`patchset-created` will be used.
1560
David Pursehoused556c192012-06-12 18:34:37 +09001561[[hooks.draftPublishedHook]]hooks.draftPublishedHook::
1562+
1563Optional filename for the draft published hook, if not specified then
1564`draft-published` will be used.
1565
Shane Mc Cormack6c2b6772010-01-12 21:56:44 +00001566[[hooks.commentAddedHook]]hooks.commentAddedHook::
1567+
1568Optional filename for the comment added hook, if not specified then
1569`comment-added` will be used.
1570
1571[[hooks.changeMergedHook]]hooks.changeMergedHook::
1572+
1573Optional filename for the change merged hook, if not specified then
1574`change-merged` will be used.
1575
David Pursehousef9f3b272012-09-28 19:58:59 +09001576[[hooks.mergeFailedHook]]hooks.mergeFailedHook::
1577+
1578Optional filename for the merge failed hook, if not specified then
1579`merge-failed` will be used.
1580
Shane Mc Cormack6c2b6772010-01-12 21:56:44 +00001581[[hooks.changeAbandonedHook]]hooks.changeAbandonedHook::
1582+
1583Optional filename for the change abandoned hook, if not specified then
1584`change-abandoned` will be used.
1585
David Pursehousea93c9302012-06-15 16:29:26 +09001586[[hooks.changeRestoredHook]]hooks.changeRestoredHook::
1587+
1588Optional filename for the change restored hook, if not specified then
1589`change-restored` will be used.
1590
1591[[hooks.refUpdatedHook]]hooks.refUpdatedHook::
1592+
1593Optional filename for the ref updated hook, if not specified then
1594`ref-updated` will be used.
1595
David Pursehouse2336bd82012-09-21 12:50:19 +09001596[[hooks.reviewerAddedHook]]hooks.reviewerAddedHook::
1597+
1598Optional filename for the reviewer added hook, if not specified then
1599`reviewer-added` will be used.
1600
David Pursehouseba3e28d2013-07-12 14:48:51 +09001601[[hooks.topicChangedHook]]hooks.topicChangedHook::
1602+
1603Optional filename for the topic changed hook, if not specified then
1604`topic-changed` will be used.
1605
David Pursehousea93c9302012-06-15 16:29:26 +09001606[[hooks.claSignedHook]]hooks.claSignedHook::
1607+
1608Optional filename for the CLA signed hook, if not specified then
1609`cla-signed` will be used.
1610
Chris Harrisf736d6c2012-11-21 09:35:56 -05001611[[hooks.refUpdateHook]]hooks.refUpdateHook::
1612+
1613Optional filename for the ref update hook, if not specified then
1614`ref-update` will be used.
1615
1616[[hooks.syncHookTimeout]]hooks.syncHookTimeout::
David Pursehouse6fdc8d92012-11-28 12:34:18 +09001617+
1618Optional timeout value in seconds for synchronous hooks, if not specified
Chris Harrisf736d6c2012-11-21 09:35:56 -05001619then 30 seconds will be used.
1620
Yuxuan 'fishy' Wang3fba03a2013-12-10 15:08:11 -08001621[[http]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08001622=== Section http
Shawn O. Pearce309d8d32009-11-17 16:03:16 -08001623
1624[[http.proxy]]http.proxy::
Shawn O. Pearce9d342a42009-12-16 15:49:05 -08001625+
1626URL of the proxy server when making outgoing HTTP
1627connections for OpenID login transactions. Syntax
1628should be `http://`'hostname'`:`'port'.
Shawn O. Pearce309d8d32009-11-17 16:03:16 -08001629
1630[[http.proxyUsername]]http.proxyUsername::
Shawn O. Pearce9d342a42009-12-16 15:49:05 -08001631+
1632Optional username to authenticate to the HTTP proxy with.
Robin Rosenberg524a3032012-10-14 14:24:36 +02001633This property is honored only if the username does not
Shawn O. Pearce9d342a42009-12-16 15:49:05 -08001634appear in the http.proxy property above.
Shawn O. Pearce309d8d32009-11-17 16:03:16 -08001635
1636[[http.proxyPassword]]http.proxyPassword::
Shawn O. Pearce9d342a42009-12-16 15:49:05 -08001637+
1638Optional password to authenticate to the HTTP proxy with.
Robin Rosenberg524a3032012-10-14 14:24:36 +02001639This property is honored only if the password does not
Shawn O. Pearce9d342a42009-12-16 15:49:05 -08001640appear in the http.proxy property above.
Shawn O. Pearce309d8d32009-11-17 16:03:16 -08001641
1642
Yuxuan 'fishy' Wang3fba03a2013-12-10 15:08:11 -08001643[[httpd]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08001644=== Section httpd
Shawn O. Pearcefa2486a2009-11-11 14:51:30 -08001645
1646The httpd section configures the embedded servlet container.
1647
1648[[httpd.listenUrl]]httpd.listenUrl::
1649+
1650Specifies the URLs the internal HTTP daemon should listen for
Edwin Kempincdb0e002011-09-08 14:23:30 +02001651connections on. The special hostname '*' may be used to listen
Shawn O. Pearcefa2486a2009-11-11 14:51:30 -08001652on all local addresses. A context path may optionally be included,
1653placing Gerrit Code Review's web address within a subdirectory of
1654the server.
1655+
1656Multiple protocol schemes are supported:
1657+
1658* `http://`'hostname'`:`'port'
1659+
1660Plain-text HTTP protocol. If port is not supplied, defaults to 80,
1661the standard HTTP port.
1662+
1663* `https://`'hostname'`:`'port'
1664+
1665SSL encrypted HTTP protocol. If port is not supplied, defaults to
1666443, the standard HTTPS port.
1667+
1668Externally facing production sites are encouraged to use a reverse
1669proxy configuration and `proxy-https://` (below), rather than using
1670the embedded servlet container to implement the SSL processing.
1671The proxy server with SSL support is probably easier to configure,
1672provides more configuration options to control cipher usage, and
1673is likely using natively compiled encryption algorithms, resulting
1674in higher throughput.
1675+
1676* `proxy-http://`'hostname'`:`'port'
1677+
1678Plain-text HTTP relayed from a reverse proxy. If port is not
1679supplied, defaults to 8080.
1680+
1681Like http, but additional header parsing features are
1682enabled to honor X-Forwarded-For, X-Forwarded-Host and
1683X-Forwarded-Server. These headers are typically set by Apache's
1684link:http://httpd.apache.org/docs/2.2/mod/mod_proxy.html#x-headers[mod_proxy].
1685+
1686* `proxy-https://`'hostname'`:`'port'
1687+
1688Plain text HTTP relayed from a reverse proxy that has already
1689handled the SSL encryption/decryption. If port is not supplied,
1690defaults to 8080.
1691+
1692Behaves exactly like proxy-http, but also sets the scheme to assume
1693'https://' is the proper URL back to the server.
1694
1695+
1696If multiple values are supplied, the daemon will listen on all
1697of them.
1698+
1699By default, http://*:8080.
1700
1701[[httpd.reuseAddress]]httpd.reuseAddress::
1702+
1703If true, permits the daemon to bind to the port even if the port
1704is already in use. If false, the daemon ensures the port is not
1705in use before starting. Busy sites may need to set this to true
1706to permit fast restarts.
1707+
1708By default, true.
1709
1710[[httpd.requestHeaderSize]]httpd.requestHeaderSize::
1711+
1712Size, in bytes, of the buffer used to parse the HTTP headers of an
1713incoming HTTP request. The entire request headers, including any
1714cookies sent by the browser, must fit within this buffer, otherwise
1715the server aborts with the response '413 Request Entity Too Large'.
1716+
1717One buffer of this size is allocated per active connection.
1718Allocating a buffer that is too large wastes memory that cannot be
1719reclaimed, allocating a buffer that is too small may cause unexpected
1720errors caused by very long Referer URLs or large cookie values.
1721+
1722By default, 16384 (16 K), which is sufficient for most OpenID and
1723other web-based single-sign-on integrations.
1724
Chulho Yangb72ff8f2013-07-04 02:35:53 -04001725[[httpd.sslCrl]]httpd.sslCrl::
1726+
1727Path of the certificate revocation list file in PEM format. This
1728crl file is optional, and available for CLIENT_SSL_CERT_LDAP
1729authentication.
1730+
1731To create and view a crl using openssl:
1732+
1733----
1734openssl ca -gencrl -out crl.pem
1735openssl crl -in crl.pem -text
1736----
1737+
1738If not absolute, the path is resolved relative to `$site_path`.
1739+
1740By default, `$site_path/etc/crl.pem`.
1741
Shawn O. Pearcefa2486a2009-11-11 14:51:30 -08001742[[httpd.sslKeyStore]]httpd.sslKeyStore::
1743+
1744Path of the Java keystore containing the server's SSL certificate
1745and private key. This keystore is required for `https://` in URL.
1746+
1747To create a self-signed certificate for simple internal usage:
1748+
Shawn O. Pearce9d342a42009-12-16 15:49:05 -08001749----
1750keytool -keystore keystore -alias jetty -genkey -keyalg RSA
1751chmod 600 keystore
1752----
Shawn O. Pearcefa2486a2009-11-11 14:51:30 -08001753+
1754If not absolute, the path is resolved relative to `$site_path`.
1755+
Shawn O. Pearcec5fed822009-11-17 16:10:10 -08001756By default, `$site_path/etc/keystore`.
Shawn O. Pearcefa2486a2009-11-11 14:51:30 -08001757
1758[[httpd.sslKeyPassword]]httpd.sslKeyPassword::
1759+
1760Password used to decrypt the private portion of the sslKeyStore.
David Pursehouse221d4f62012-06-08 17:38:08 +09001761Java keystores require a password, even if the administrator
Shawn O. Pearcefa2486a2009-11-11 14:51:30 -08001762doesn't want to enable one.
1763+
1764If set to the empty string the embedded server will prompt for the
1765password during startup.
1766+
1767By default, `gerrit`.
1768
Shawn O. Pearce1766f502010-01-15 10:49:46 -08001769[[httpd.requestLog]]httpd.requestLog::
1770+
1771Enable (or disable) the `'$site_path'/logs/httpd_log` request log.
1772If enabled, an NCSA combined log format request log file is written
1773out by the internal HTTP daemon.
1774+
David Ostrovsky8e4a9902013-11-19 23:57:48 +01001775`log4j.appender` with the name `httpd_log` can be configured to overwrite
1776programmatic configuration.
1777+
Shawn O. Pearce1766f502010-01-15 10:49:46 -08001778By default, true if httpd.listenUrl uses http:// or https://,
1779and false if httpd.listenUrl uses proxy-http:// or proxy-https://.
1780
Shawn O. Pearcefa2486a2009-11-11 14:51:30 -08001781[[httpd.acceptorThreads]]httpd.acceptorThreads::
1782+
1783Number of worker threads dedicated to accepting new incoming TCP
David Pursehouse221d4f62012-06-08 17:38:08 +09001784connections and allocating them connection-specific resources.
Shawn O. Pearcefa2486a2009-11-11 14:51:30 -08001785+
1786By default, 2, which should be suitable for most high-traffic sites.
1787
1788[[httpd.minThreads]]httpd.minThreads::
1789+
1790Minimum number of spare threads to keep in the worker thread pool.
1791This number must be at least 1 larger than httpd.acceptorThreads
David Pursehouse92463562013-06-24 10:16:28 +09001792multiplied by the number of httpd.listenUrls configured.
Shawn O. Pearcefa2486a2009-11-11 14:51:30 -08001793+
1794By default, 5, suitable for most lower-volume traffic sites.
1795
1796[[httpd.maxThreads]]httpd.maxThreads::
1797+
1798Maximum number of threads to permit in the worker thread pool.
1799+
1800By default 25, suitable for most lower-volume traffic sites.
1801
1802[[httpd.maxQueued]]httpd.maxQueued::
1803+
1804Maximum number of client connections which can enter the worker
1805thread pool waiting for a worker thread to become available.
18060 disables the queue and permits infinite number of connections.
1807+
1808By default 50.
1809
Shawn O. Pearcee5452b72010-01-15 14:32:50 -08001810[[httpd.maxWait]]httpd.maxWait::
1811+
David Pursehouse221d4f62012-06-08 17:38:08 +09001812Maximum amount of time a client will wait for an available
Shawn O. Pearcee5452b72010-01-15 14:32:50 -08001813thread to handle a project clone, fetch or push request over the
1814smart HTTP transport.
1815+
1816Values should use common unit suffixes to express their setting:
1817+
1818* s, sec, second, seconds
1819* m, min, minute, minutes
1820* h, hr, hour, hours
1821* d, day, days
1822* w, week, weeks (`1 week` is treated as `7 days`)
1823* mon, month, months (`1 month` is treated as `30 days`)
1824* y, year, years (`1 year` is treated as `365 days`)
1825
1826+
1827If a unit suffix is not specified, `minutes` is assumed. If 0
1828is supplied, the maximum age is infinite and connections will not
1829abort until the client disconnects.
1830+
1831By default, 5 minutes.
1832
Luca Milanesioce7b7452013-06-18 11:40:49 +01001833[[httpd.filterClass]]httpd.filterClass::
1834+
1835Class that implements the javax.servlet.Filter interface
1836for filtering any HTTP related traffic going through the Gerrit
1837HTTP protocol.
1838Class is loaded and configured in the Gerrit Jetty container
1839and run in front of all Gerrit URL handlers, allowing the filter
1840to inspect, modify, allow or reject each request.
1841It needs to be provided as JAR library
1842under $GERRIT_SITE/lib as it is resolved using the default Gerrit class
1843loader and cannot be dynamically loaded by a plugin.
1844+
1845Failing to load the Filter class would result in a Gerrit start-up
1846failure, as this class is supposed to provide mandatory filtering
1847in front of Gerrit HTTP protocol.
1848+
David Pursehouse42f42042013-08-01 14:02:25 +09001849Typical usage is in conjunction with the `auth.type=HTTP` as replacement
Luca Milanesioce7b7452013-06-18 11:40:49 +01001850of an Apache HTTP proxy layer as security enforcement on top of Gerrit
1851by returning a trusted username as HTTP Header.
1852+
1853Example of using a security library secure.jar under $GERRIT_SITE/lib
1854that provides a org.anyorg.MySecureFilter Servlet Filter that enforces
1855a trusted username in the `TRUSTED_USER` HTTP Header:
1856
1857----
1858[auth]
1859type = HTTP
1860httpHeader = TRUSTED_USER
1861
1862[http]
1863filterClass = org.anyorg.MySecureFilter
1864----
Shawn O. Pearcefa2486a2009-11-11 14:51:30 -08001865
Juan Hernandezec512562013-08-06 16:30:50 +02001866[[httpd.robotsFile]]httpd.robotsFile::
1867+
1868Location of an external robots.txt file to be used instead of the one
1869bundled with the .war of the application.
1870+
1871If not absolute, the path is resolved relative to `$site_path`.
1872+
1873If the file doesn't exist or can't be read the default robots.txt file
1874bundled with the .war will be used instead.
1875
Yuxuan 'fishy' Wang3fba03a2013-12-10 15:08:11 -08001876[[index]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08001877=== Section index
David Pursehouse6d458432013-08-23 16:17:18 +09001878
1879The index section configures the secondary index.
1880
1881[[index.type]]index.type::
1882+
1883Type of secondary indexing employed by Gerrit. The supported
1884values are:
1885+
1886* `LUCENE`
1887+
1888A link:http://lucene.apache.org/[Lucene] index is used.
1889+
1890* `SOLR`
1891+
1892A link:http://lucene.apache.org/solr/[Solr] index is used.
David Pursehouse6d458432013-08-23 16:17:18 +09001893
1894+
Shawn Pearced4ae3a162013-11-24 17:00:31 -08001895By default, `LUCENE`.
David Pursehousee474ddf2013-11-26 12:22:54 +09001896+
Shawn Pearced4ae3a162013-11-24 17:00:31 -08001897After changing the secondary index type, the index must be rebuilt
1898using the link:pgm-reindex.html[reindex program] before restarting the
David Pursehousee474ddf2013-11-26 12:22:54 +09001899Gerrit server.
David Pursehouse6d458432013-08-23 16:17:18 +09001900
David Pursehouse00c82142014-01-22 17:41:09 +09001901Open and closed changes are indexed in separate indexes named
1902'changes_open' and 'changes_closed' respectively.
1903
1904[[index.name.ramBufferSize]]index.name.ramBufferSize::
1905+
1906Only used when the type is `LUCENE`.
1907+
1908Determines the amount of RAM that may be used for buffering added documents
1909and deletions before they are flushed to the index. See the
1910link:http://lucene.apache.org/core/4_6_0/core/org/apache/lucene/index/LiveIndexWriterConfig.html#setRAMBufferSizeMB(double)[
1911Lucene documentation] for further details.
1912+
1913Defaults to 16M.
1914
1915[[index.name.maxBufferedDocs]]index.name.maxBufferedDocs::
1916+
1917Only used when the type is `LUCENE`.
1918+
1919Determines the minimal number of documents required before the buffered
1920in-memory documents are flushed to the index. Large values generally
1921give faster indexing. See the
1922link:http://lucene.apache.org/core/4_6_0/core/org/apache/lucene/index/LiveIndexWriterConfig.html#setMaxBufferedDocs(int)[
1923Lucene documentation] for further details.
1924+
1925Defaults to -1, meaning no maximum is set and the writer will flush
1926according to RAM usage.
1927
1928Sample index configuration:
1929----
1930[index]
1931 type = LUCENE
1932
1933[index "changes_open"]
1934 ramBufferSize = 60 m
1935 maxBufferedDocs = 3000
1936
1937[index "changes_closed"]
1938 ramBufferSize = 20 m
1939 maxBufferedDocs = 500
1940----
1941
Yuxuan 'fishy' Wang3fba03a2013-12-10 15:08:11 -08001942[[ldap]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08001943=== Section ldap
Shawn O. Pearce302a7dd2009-08-18 19:33:15 -07001944
David Pursehouse221d4f62012-06-08 17:38:08 +09001945LDAP integration is only enabled if `auth.type` is set to
Sasa Zivkoveabc8972010-10-04 15:47:08 +02001946`HTTP_LDAP`, `LDAP` or `CLIENT_SSL_CERT_LDAP`. See above for a
David Pursehouse42f42042013-08-01 14:02:25 +09001947detailed description of the `auth.type` settings and their
Sasa Zivkoveabc8972010-10-04 15:47:08 +02001948implications.
Shawn O. Pearce302a7dd2009-08-18 19:33:15 -07001949
Shawn O. Pearce02c2e802009-10-29 14:46:03 -07001950An example LDAP configuration follows, and then discussion of
1951the parameters introduced here. Suitable defaults for most
1952parameters are automatically guessed based on the type of server
1953detected during startup. The guessed defaults support both
1954link:http://www.ietf.org/rfc/rfc2307.txt[RFC 2307] and Active
1955Directory.
Shawn O. Pearce302a7dd2009-08-18 19:33:15 -07001956
Shawn O. Pearce9d342a42009-12-16 15:49:05 -08001957----
1958[ldap]
1959 server = ldap://ldap.example.com
1960
1961 accountBase = ou=people,dc=example,dc=com
1962 accountPattern = (&(objectClass=person)(uid=${username}))
1963 accountFullName = displayName
1964 accountEmailAddress = mail
1965
1966 groupBase = ou=groups,dc=example,dc=com
1967 groupMemberPattern = (&(objectClass=group)(member=${dn}))
1968----
Shawn O. Pearce302a7dd2009-08-18 19:33:15 -07001969
Shawn O. Pearce92a7fd12009-08-18 19:52:48 -07001970[[ldap.server]]ldap.server::
Shawn O. Pearce302a7dd2009-08-18 19:33:15 -07001971+
1972URL of the organization's LDAP server to query for user information
1973and group membership from. Must be of the form `ldap://host` or
1974`ldaps://host` to bind with either a plaintext or SSL connection.
Shawn O. Pearcef7e065e2009-09-26 20:01:10 -07001975+
David Pursehouse42f42042013-08-01 14:02:25 +09001976If `auth.type` is `LDAP` this setting should use `ldaps://` to
Shawn O. Pearcef7e065e2009-09-26 20:01:10 -07001977ensure the end user's plaintext password is transmitted only over
1978an encrypted connection.
Shawn O. Pearce302a7dd2009-08-18 19:33:15 -07001979
Shawn O. Pearce02c2e802009-10-29 14:46:03 -07001980[[ldap.sslVerify]]ldap.sslVerify::
1981+
1982If false and ldap.server is an `ldaps://` style URL, Gerrit
1983will not verify the server certificate when it connects to
1984perform a query.
1985+
1986By default, true, requiring the certificate to be verified.
1987
Shawn O. Pearce92a7fd12009-08-18 19:52:48 -07001988[[ldap.username]]ldap.username::
Shawn O. Pearce302a7dd2009-08-18 19:33:15 -07001989+
1990_(Optional)_ Username to bind to the LDAP server with. If not set,
1991an anonymous connection to the LDAP server is attempted.
1992
Shawn O. Pearce92a7fd12009-08-18 19:52:48 -07001993[[ldap.password]]ldap.password::
Shawn O. Pearce302a7dd2009-08-18 19:33:15 -07001994+
1995_(Optional)_ Password for the user identified by `ldap.username`.
1996If not set, an anonymous (or passwordless) connection to the LDAP
1997server is attempted.
1998
Ben Wu0410a152010-06-04 16:17:24 +08001999[[ldap.referral]]ldap.referral::
2000+
2001_(Optional)_ How an LDAP referral should be handled if it is
2002encountered during directory traversal. Set to `follow` to
James Y Knight1244ed02011-01-04 02:40:32 -05002003automatically follow any referrals, or `ignore` to ignore the
2004referrals.
Ben Wu0410a152010-06-04 16:17:24 +08002005+
2006By default, `ignore`.
2007
Sasa Zivkov100bd4b2011-11-07 14:58:46 +01002008[[ldap.readTimeout]]ldap.readTimeout::
2009+
2010_(Optional)_ The read timeout for an LDAP operation. The value is
2011in the usual time-unit format like "1 s", "100 ms", etc...
2012A timeout can be used to avoid blocking all of the SSH command start
David Pursehouse221d4f62012-06-08 17:38:08 +09002013threads in case the LDAP server becomes slow.
Sasa Zivkov100bd4b2011-11-07 14:58:46 +01002014+
2015By default there is no timeout and Gerrit will wait for the LDAP
2016server to respond until the TCP connection times out.
2017
Shawn O. Pearce92a7fd12009-08-18 19:52:48 -07002018[[ldap.accountBase]]ldap.accountBase::
Shawn O. Pearce302a7dd2009-08-18 19:33:15 -07002019+
2020Root of the tree containing all user accounts. This is typically
2021of the form `ou=people,dc=example,dc=com`.
2022
Shawn O. Pearce304ccdb2009-08-25 12:25:27 -07002023[[ldap.accountScope]]ldap.accountScope::
2024+
2025Scope of the search performed for accounts. Must be one of:
2026+
2027* `one`: Search only one level below accountBase, but not recursive
2028* `sub` or `subtree`: Search recursively below accountBase
2029* `base` or `object`: Search exactly accountBase; probably not desired
2030
2031+
2032Default is `subtree` as many directories have several levels.
2033
Shawn O. Pearce92a7fd12009-08-18 19:52:48 -07002034[[ldap.accountPattern]]ldap.accountPattern::
Shawn O. Pearce302a7dd2009-08-18 19:33:15 -07002035+
2036Query pattern to use when searching for a user account. This may be
2037any valid LDAP query expression, including the standard `(&...)` and
David Pursehouse42f42042013-08-01 14:02:25 +09002038`(|...)` operators. If `auth.type` is `HTTP_LDAP` then the variable
Edwin Kempincdb0e002011-09-08 14:23:30 +02002039`${username}` is replaced with a parameter set to the username
David Pursehouse42f42042013-08-01 14:02:25 +09002040that was supplied by the HTTP server. If `auth.type` is `LDAP` then
Edwin Kempincdb0e002011-09-08 14:23:30 +02002041the variable `${username}` is replaced by the string entered by
Shawn O. Pearcef7e065e2009-09-26 20:01:10 -07002042the end user.
Shawn O. Pearce302a7dd2009-08-18 19:33:15 -07002043+
2044This pattern is used to search the objects contained directly under
2045the `ldap.accountBase` tree. A typical setting for this parameter
Edwin Kempincdb0e002011-09-08 14:23:30 +02002046is `(uid=${username})` or `(cn=${username})`, but the proper
Shawn O. Pearce302a7dd2009-08-18 19:33:15 -07002047setting depends on the LDAP schema used by the directory server.
2048+
Edwin Kempincdb0e002011-09-08 14:23:30 +02002049Default is `(uid=${username})` for RFC 2307 servers,
Shawn O. Pearce02c2e802009-10-29 14:46:03 -07002050and `(&(objectClass=user)(sAMAccountName=${username}))`
2051for Active Directory.
Shawn O. Pearce302a7dd2009-08-18 19:33:15 -07002052
Shawn O. Pearce37dc1f82009-08-19 09:49:07 -07002053[[ldap.accountFullName]]ldap.accountFullName::
Shawn O. Pearce302a7dd2009-08-18 19:33:15 -07002054+
2055_(Optional)_ Name of an attribute on the user account object which
2056contains the initial value for the user's full name field in Gerrit.
2057Typically this is the `displayName` property in LDAP, but could
2058also be `legalName` or `cn`.
2059+
David Pursehouse221d4f62012-06-08 17:38:08 +09002060Attribute values may be concatenated with literal strings. For
2061example to join given name and surname together, use the pattern
Edwin Kempincdb0e002011-09-08 14:23:30 +02002062`${givenName} ${SN}`.
Shawn O. Pearceb86ae002009-09-26 16:54:05 -07002063+
Shawn O. Pearce3ca1dcf2009-08-20 08:56:23 -07002064If set, users will be unable to modify their full name field, as
2065Gerrit will populate it only from the LDAP data.
2066+
Shawn O. Pearce02c2e802009-10-29 14:46:03 -07002067Default is `displayName` for RFC 2307 servers,
2068and `${givenName} ${sn}` for Active Directory.
Shawn O. Pearce302a7dd2009-08-18 19:33:15 -07002069
Shawn O. Pearce92a7fd12009-08-18 19:52:48 -07002070[[ldap.accountEmailAddress]]ldap.accountEmailAddress::
Shawn O. Pearce302a7dd2009-08-18 19:33:15 -07002071+
2072_(Optional)_ Name of an attribute on the user account object which
2073contains the user's Internet email address, as defined by this
2074LDAP server.
2075+
Shawn O. Pearceb86ae002009-09-26 16:54:05 -07002076Attribute values may be concatenated with literal strings,
2077for example to set the email address to the lowercase form
2078of sAMAccountName followed by a constant domain name, use
Edwin Kempincdb0e002011-09-08 14:23:30 +02002079`${sAMAccountName.toLowerCase}@example.com`.
Shawn O. Pearceb86ae002009-09-26 16:54:05 -07002080+
Shawn O. Pearce3ca1dcf2009-08-20 08:56:23 -07002081If set, the preferred email address will be prefilled from LDAP,
David Pursehouse221d4f62012-06-08 17:38:08 +09002082but users may still be able to register additional email addresses,
Shawn O. Pearce3ca1dcf2009-08-20 08:56:23 -07002083and select a different preferred email address.
2084+
Shawn O. Pearce02c2e802009-10-29 14:46:03 -07002085Default is `mail`.
Shawn O. Pearce302a7dd2009-08-18 19:33:15 -07002086
Shawn O. Pearce59e09222009-08-19 09:04:49 -07002087[[ldap.accountSshUserName]]ldap.accountSshUserName::
2088+
2089_(Optional)_ Name of an attribute on the user account object which
2090contains the initial value for the user's SSH username field in
2091Gerrit. Typically this is the `uid` property in LDAP, but could
2092also be `cn`. Administrators should prefer to match the attribute
2093corresponding to the user's workstation username, as this is what
2094SSH clients will default to.
2095+
Shawn O. Pearceb86ae002009-09-26 16:54:05 -07002096Attribute values may also be forced to lowercase, or to uppercase in
Edwin Kempincdb0e002011-09-08 14:23:30 +02002097an expression. For example, `${sAMAccountName.toLowerCase}` will
Shawn O. Pearceb86ae002009-09-26 16:54:05 -07002098force the value of sAMAccountName, if defined, to be all lowercase.
2099The suffix `.toUpperCase` can be used for the other direction.
2100The suffix `.localPart` can be used to split attribute values of
2101the form 'user@example.com' and return only the left hand side, for
Edwin Kempincdb0e002011-09-08 14:23:30 +02002102example `${userPrincipalName.localPart}` would provide only 'user'.
Shawn O. Pearceb86ae002009-09-26 16:54:05 -07002103+
Shawn O. Pearce3ca1dcf2009-08-20 08:56:23 -07002104If set, users will be unable to modify their SSH username field, as
2105Gerrit will populate it only from the LDAP data.
2106+
Shawn O. Pearce02c2e802009-10-29 14:46:03 -07002107Default is `uid` for RFC 2307 servers,
2108and `${sAMAccountName.toLowerCase}` for Active Directory.
Shawn O. Pearce59e09222009-08-19 09:04:49 -07002109
Shawn O. Pearce7d25f782009-10-30 08:01:03 -07002110[[ldap.accountMemberField]]ldap.accountMemberField::
Anthony93de7db2009-10-03 10:01:50 -04002111+
2112_(Optional)_ Name of an attribute on the user account object which
Shawn O. Pearce7d25f782009-10-30 08:01:03 -07002113contains the groups the user is part of. Typically used for Active
2114Directory servers.
Anthony93de7db2009-10-03 10:01:50 -04002115+
Shawn O. Pearce02c2e802009-10-29 14:46:03 -07002116Default is unset for RFC 2307 servers (disabled)
2117and `memberOf` for Active Directory.
Anthony93de7db2009-10-03 10:01:50 -04002118
Shawn O. Pearce92a7fd12009-08-18 19:52:48 -07002119[[ldap.groupBase]]ldap.groupBase::
Shawn O. Pearce302a7dd2009-08-18 19:33:15 -07002120+
2121Root of the tree containing all group objects. This is typically
2122of the form `ou=groups,dc=example,dc=com`.
2123
Shawn O. Pearce304ccdb2009-08-25 12:25:27 -07002124[[ldap.groupScope]]ldap.groupScope::
2125+
2126Scope of the search performed for group objects. Must be one of:
2127+
2128* `one`: Search only one level below groupBase, but not recursive
2129* `sub` or `subtree`: Search recursively below groupBase
2130* `base` or `object`: Search exactly groupBase; probably not desired
2131
2132+
2133Default is `subtree` as many directories have several levels.
2134
Shawn O. Pearce7d25f782009-10-30 08:01:03 -07002135[[ldap.groupPattern]]ldap.groupPattern::
2136+
2137Query pattern used when searching for an LDAP group to connect
2138to a Gerrit group. This may be any valid LDAP query expression,
2139including the standard `(&...)` and `(|...)` operators. The variable
Edwin Kempincdb0e002011-09-08 14:23:30 +02002140`${groupname}` is replaced with the search term supplied by the
Shawn O. Pearce7d25f782009-10-30 08:01:03 -07002141group owner.
2142+
Edwin Kempincdb0e002011-09-08 14:23:30 +02002143Default is `(cn=${groupname})` for RFC 2307,
2144and `(&(objectClass=group)(cn=${groupname}))` for Active Directory.
Shawn O. Pearce7d25f782009-10-30 08:01:03 -07002145
Shawn O. Pearce92a7fd12009-08-18 19:52:48 -07002146[[ldap.groupMemberPattern]]ldap.groupMemberPattern::
Shawn O. Pearce302a7dd2009-08-18 19:33:15 -07002147+
2148Query pattern to use when searching for the groups that a user
2149account is currently a member of. This may be any valid LDAP query
2150expression, including the standard `(&...)` and `(|...)` operators.
2151+
David Pursehouse42f42042013-08-01 14:02:25 +09002152If `auth.type` is `HTTP_LDAP` then the variable `${username}` is
Shawn O. Pearce302a7dd2009-08-18 19:33:15 -07002153replaced with a parameter set to the username that was supplied
2154by the HTTP server. Other variables appearing in the pattern,
Edwin Kempincdb0e002011-09-08 14:23:30 +02002155such as `${fooBarAttribute}`, are replaced with the value of the
Shawn O. Pearce302a7dd2009-08-18 19:33:15 -07002156corresponding attribute (in this case, `fooBarAttribute`) as read
2157from the user's account object matched under `ldap.accountBase`.
Edwin Kempincdb0e002011-09-08 14:23:30 +02002158Attributes such as `${dn}` or `${uidNumber}` may be useful.
Shawn O. Pearce302a7dd2009-08-18 19:33:15 -07002159+
Scott Dial50457502013-08-11 16:52:51 -04002160Default is `(|(memberUid=${username})(gidNumber=${gidNumber}))` for
2161RFC 2307, and unset (disabled) for Active Directory.
Shawn O. Pearce302a7dd2009-08-18 19:33:15 -07002162
Auke Schrijnen57809132012-09-26 21:05:39 +02002163[[ldap.groupName]]ldap.groupName::
2164+
David Pursehouse39489ae2012-10-12 13:50:04 +09002165_(Optional)_ Name of the attribute on the group object which contains
2166the value to use as the group name in Gerrit.
Auke Schrijnen57809132012-09-26 21:05:39 +02002167+
David Pursehouse39489ae2012-10-12 13:50:04 +09002168Typically the attribute name is `cn` for RFC 2307 and Active Directory
2169servers. For other servers the attribute name may differ, for example
2170`apple-group-realname` on Apple MacOS X Server.
Auke Schrijnen57809132012-09-26 21:05:39 +02002171+
David Pursehouse39489ae2012-10-12 13:50:04 +09002172It is also possible to specify a literal string containing a pattern of
2173attribute values. For example to create a Gerrit group name consisting of
2174LDAP group name and group ID, use the pattern `${cn} (${gidNumber})`.
2175+
2176Default is `cn`.
Auke Schrijnen57809132012-09-26 21:05:39 +02002177
Edwin Kempinb3b0d292011-09-14 14:17:34 +02002178[[ldap.localUsernameToLowerCase]]ldap.localUsernameToLowerCase::
2179+
2180Converts the local username, that is used to login into the Gerrit
2181WebUI, to lower case before doing the LDAP authentication. By setting
2182this parameter to true, a case insensitive login to the Gerrit WebUI
2183can be achieved.
2184+
2185If set, it must be ensured that the local usernames for all existing
2186accounts are converted to lower case, otherwise a user that has a
David Pursehouse221d4f62012-06-08 17:38:08 +09002187local username that contains upper case characters will not be able to login
Edwin Kempinb3b0d292011-09-14 14:17:34 +02002188anymore. The local usernames for the existing accounts can be
2189converted to lower case by running the server program
2190link:pgm-LocalUsernamesToLowerCase.html[LocalUsernamesToLowerCase].
2191Please be aware that the conversion of the local usernames to lower
2192case can't be undone. For newly created accounts the local username
2193will be directly stored in lower case.
2194+
2195By default, unset/false.
Shawn O. Pearce302a7dd2009-08-18 19:33:15 -07002196
Robin Rosenberga3baed02012-10-14 14:09:32 +02002197[[ldap.authentication]]ldap.authentication::
2198+
2199Defines how Gerrit authenticates with the server. When set to `GSSAPI`
2200Gerrit will use Kerberos. To use kerberos the
2201`java.security.auth.login.config` system property must point to a
2202login to a JAAS configuration file and, if Java 6 is used, the system
2203property `java.security.krb5.conf` must point to the appropriate
2204krb5.ini file with references to the KDC.
2205
2206Typical jaas.conf.
2207
2208----
2209KerberosLogin {
2210 com.sun.security.auth.module.Krb5LoginModule
2211 required
2212 useTicketCache=true
2213 doNotPrompt=true
2214 renewTGT=true;
2215};
2216----
2217
2218See Java documentation on how to create the krb5.ini file.
2219
2220Note the `renewTGT` property to make sure the TGT does not expire,
2221and `useTicketCache` to use the TGT supplied by the operating system. As
2222the whole point of using GSSAPI is to have passwordless authentication
David Pursehouse92463562013-06-24 10:16:28 +09002223to the LDAP service, this option does not acquire a new TGT on its own.
Robin Rosenberga3baed02012-10-14 14:09:32 +02002224
2225On Windows servers the registry key `HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\Lsa\Kerberos\Parameters`
2226must have the DWORD value `allowtgtsessionkey` set to 1 and the account must not
2227have local administrator privileges.
2228
Yuxuan 'fishy' Wang3fba03a2013-12-10 15:08:11 -08002229[[mimetype]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08002230=== Section mimetype
Shawn O. Pearce01cb11902009-07-15 08:19:01 -07002231
Shawn O. Pearce92a7fd12009-08-18 19:52:48 -07002232[[mimetype.name.safe]]mimetype.<name>.safe::
Shawn O. Pearce01cb11902009-07-15 08:19:01 -07002233+
2234If set to true, files with the MIME type `<name>` will be sent as
2235direct downloads to the user's browser, rather than being wrapped up
2236inside of zipped archives. The type name may be a complete type
Edwin Kempincdb0e002011-09-08 14:23:30 +02002237name, e.g. `image/gif`, a generic media type, e.g. `image/*`,
2238or the wildcard `*/*` to match all types.
Shawn O. Pearce01cb11902009-07-15 08:19:01 -07002239+
2240By default, false for all MIME types.
2241
2242Common examples:
Shawn O. Pearce9d342a42009-12-16 15:49:05 -08002243----
2244[mimetype "image/*"]
2245 safe = true
2246
2247[mimetype "application/pdf"]
2248 safe = true
2249
2250[mimetype "application/msword"]
2251 safe = true
2252
2253[mimetype "application/vnd.ms-excel"]
2254 safe = true
2255----
Shawn O. Pearce01cb11902009-07-15 08:19:01 -07002256
Shawn O. Pearce5f11b292010-08-05 17:57:35 -07002257
Yuxuan 'fishy' Wang3fba03a2013-12-10 15:08:11 -08002258[[pack]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08002259=== Section pack
Yuxuan 'fishy' Wang3fba03a2013-12-10 15:08:11 -08002260
Shawn O. Pearce5f11b292010-08-05 17:57:35 -07002261Global settings controlling how Gerrit Code Review creates pack
2262streams for Git clients running clone, fetch, or pull. Most of these
2263variables are per-client request, and thus should be carefully set
2264given the expected concurrent request load and available CPU and
2265memory resources.
2266
2267[[pack.deltacompression]]pack.deltacompression::
2268+
2269If true, delta compression between objects is enabled. This may
2270result in a smaller overall transfer for the client, but requires
2271more server memory and CPU time.
2272+
2273False (off) by default, matching Gerrit Code Review 2.1.4.
2274
2275[[pack.threads]]pack.threads::
2276+
2277Maximum number of threads to use for delta compression (if enabled).
2278This is per-client request. If set to 0 then the number of CPUs is
2279auto-detected and one thread per CPU is used, per client request.
2280+
2281By default, 1.
2282
2283
Yuxuan 'fishy' Wang3fba03a2013-12-10 15:08:11 -08002284[[plugins]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08002285=== Section plugins
Shawn O. Pearce5ad16ea2012-05-09 14:24:25 -07002286
2287[[plugins.checkFrequency]]plugins.checkFrequency::
2288+
2289How often plugins should be examined for new plugins to load, removed
2290plugins to be unloaded, or updated plugins to be reloaded. Values can
2291be specified using standard time unit abbreviations ('ms', 'sec',
2292'min', etc.).
2293+
2294If set to 0, automatic plugin reloading is disabled. Administrators
2295may force reloading with link:cmd-plugin.html[gerrit plugin reload].
2296+
2297Default is 1 minute.
2298
2299
Yuxuan 'fishy' Wang3fba03a2013-12-10 15:08:11 -08002300[[receive]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08002301=== Section receive
Yuxuan 'fishy' Wang3fba03a2013-12-10 15:08:11 -08002302
Sasa Zivkov59d89c32011-11-18 15:32:35 +01002303This section is used to set who can execute the 'receive-pack' and
2304to limit the maximum Git object size that 'receive-pack' will accept.
2305'receive-pack' is what runs on the server during a user's push or
Dave Borowitz234734a2012-03-01 14:22:29 -08002306repo upload command. It also contains some advanced options for tuning the
2307behavior of Gerrit's 'receive-pack' mechanism.
lincoln2be11602010-07-05 10:53:25 -03002308
2309----
2310[receive]
2311 allowGroup = GROUP_ALLOWED_TO_EXECUTE
2312 allowGroup = YET_ANOTHER_GROUP_ALLOWED_TO_EXECUTE
Sasa Zivkov59d89c32011-11-18 15:32:35 +01002313 maxObjectSizeLimit = 40 m
lincoln2be11602010-07-05 10:53:25 -03002314----
2315
Shawn Pearce5cb31bf2013-02-27 16:20:26 -08002316[[receive.checkMagicRefs]]receive.checkMagicRefs::
2317+
2318If true, Gerrit will verify the destination repository has
2319no references under the magic 'refs/drafts', 'refs/for', or
2320'refs/publish' branch namespaces. Names under these locations
2321confuse clients when trying to upload code reviews so Gerrit
2322requires them to be empty.
2323+
2324If false Gerrit skips the sanity check and assumes administrators
2325have ensured the repository does not contain any magic references.
2326Setting to false to skip the check can decrease latency during push.
2327+
2328Default is true.
2329
Gustaf Lundh9062fd62013-02-14 17:23:11 +01002330[[receive.checkReferencedObjectsAreReachable]]receive.checkReferencedObjectsAreReachable::
2331+
2332If set to true, Gerrit will validate that all referenced objects that
2333are not included in the received pack are reachable by the user.
2334+
2335Carrying out this check on gits with many refs and commits can be a
2336very CPU-heavy operation. For non public Gerrit-servers this check may
2337be overkill.
2338+
2339Only disable this check if you trust the clients not to forge SHA1
2340references to access commits intended to be hidden from the user.
2341+
2342Default is true.
2343
lincoln2be11602010-07-05 10:53:25 -03002344[[receive.allowGroup]]receive.allowGroup::
2345+
2346Name of the groups of users that are allowed to execute
2347'receive-pack' on the server. One or more groups can be set.
2348+
2349If no groups are added, any user will be allowed to execute
2350'receive-pack' on the server.
2351
Sasa Zivkov59d89c32011-11-18 15:32:35 +01002352[[receive.maxObjectSizeLimit]]receive.maxObjectSizeLimit::
2353+
2354Maximum allowed Git object size that 'receive-pack' will accept.
2355If an object is larger than the given size the pack-parsing will abort
2356and the push operation will fail. If set to zero then there is no
2357limit.
2358+
David Pursehouse221d4f62012-06-08 17:38:08 +09002359Gerrit administrators can use this setting to prevent developers
Sasa Zivkov59d89c32011-11-18 15:32:35 +01002360from pushing objects which are too large to Gerrit.
2361+
Fredrik Luthandera3cf3542012-07-04 16:55:35 -07002362This setting can also be set in the `project.config`
2363link:config-project-config.html[receive.maxObjectSizeLimit] in order
2364to further reduce the global setting. The project specific setting is
2365only honored when it further reduces the global limit.
Sasa Zivkov5a708a82013-06-28 17:07:55 +02002366+
Sasa Zivkov59d89c32011-11-18 15:32:35 +01002367Default is zero.
2368+
2369Common unit suffixes of 'k', 'm', or 'g' are supported.
2370
Dave Borowitz234734a2012-03-01 14:22:29 -08002371[[receive.threadPoolSize]]receive.threadPoolSize::
2372+
2373Maximum size of the thread pool in which the change data in received packs is
2374processed.
2375+
2376Defaults to the number of available CPUs according to the Java runtime.
2377
Shawn O. Pearcec545c092012-07-27 16:38:55 -07002378[[receive.changeUpdateThreads]]receive.changeUpdateThreads::
2379+
2380Number of threads to perform change creation or patch set updates
2381concurrently. Each thread uses its own database connection from
2382the database connection pool, and if all threads are busy then
2383main receive thread will also perform a change creation or patch
2384set update.
2385+
2386Defaults to 1, using only the main receive thread. This feature is for
David Pursehouse92463562013-06-24 10:16:28 +09002387databases with very high latency that can benefit from concurrent
Shawn O. Pearcec545c092012-07-27 16:38:55 -07002388operations when multiple changes are impacted at once.
2389
Dave Borowitz1c401362012-03-02 17:39:17 -08002390[[receive.timeout]]receive.timeout::
2391+
Shawn O. Pearce00dd12d2012-03-12 15:52:11 -07002392Overall timeout on the time taken to process the change data in
2393received packs. Only includes the time processing Gerrit changes
2394and updating references, not the time to index the pack. Values can
2395be specified using standard time unit abbreviations ('ms', 'sec',
2396'min', etc.).
Dave Borowitz1c401362012-03-02 17:39:17 -08002397+
David Pursehouse92463562013-06-24 10:16:28 +09002398Default is 2 minutes. If no unit is specified, milliseconds
Shawn O. Pearce00dd12d2012-03-12 15:52:11 -07002399is assumed.
Dave Borowitz1c401362012-03-02 17:39:17 -08002400
lincoln2be11602010-07-05 10:53:25 -03002401
Yuxuan 'fishy' Wang3fba03a2013-12-10 15:08:11 -08002402[[repository]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08002403=== Section repository
Yuxuan 'fishy' Wang3fba03a2013-12-10 15:08:11 -08002404
Hugo Josefson072b4702010-04-21 19:27:11 +02002405Repositories in this sense are the same as projects.
2406
Shawn O. Pearce897d9212011-06-16 16:59:59 -07002407In the following example configuration `Registered Users` is set
2408to be the default owner of new projects.
Hugo Josefson072b4702010-04-21 19:27:11 +02002409
2410----
2411[repository "*"]
Hugo Josefson072b4702010-04-21 19:27:11 +02002412 ownerGroup = Registered Users
2413----
2414
2415[NOTE]
2416Currently only the repository name `*` is supported.
2417This is a wildcard designating all repositories.
2418
Edwin Kempina79ea552013-11-19 11:24:37 +01002419[[repository.name.defaultSubmitType]]repository.<name>.defaultSubmitType::
2420+
2421The default submit type for newly created projects. Supported values
2422are `MERGE_IF_NECESSARY`, `FAST_FORWARD_ONLY`, `REBASE_IF_NECESSARY`,
2423`MERGE_ALWAYS` and `CHERRY_PICK`.
2424+
2425By default, `MERGE_IF_NECESSARY`.
2426
Hugo Josefson072b4702010-04-21 19:27:11 +02002427[[repository.name.ownerGroup]]repository.<name>.ownerGroup::
2428+
2429A name of a group which exists in the database. Zero, one or many
2430groups are allowed. Each on its own line. Groups which don't exist
2431in the database are ignored.
Hugo Josefson072b4702010-04-21 19:27:11 +02002432
Yuxuan 'fishy' Wang3fba03a2013-12-10 15:08:11 -08002433[[rules]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08002434=== Section rules
Shawn O. Pearce94860ee2011-09-29 13:11:08 -07002435
2436[[rules.enable]]rules.enable::
2437+
Matt Baker8ce12fc2013-11-26 21:43:12 -07002438If true, Gerrit will load and execute 'rules.pl' files in each
Shawn O. Pearce94860ee2011-09-29 13:11:08 -07002439project's refs/meta/config branch, if present. When set to false,
2440only the default internal rules will be used.
2441+
2442Default is true, to execute project specific rules.
2443
Yuxuan 'fishy' Wang3fba03a2013-12-10 15:08:11 -08002444[[sendemail]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08002445=== Section sendemail
Shawn O. Pearceb0572c62009-06-01 14:18:22 -07002446
Shawn O. Pearce92a7fd12009-08-18 19:52:48 -07002447[[sendemail.enable]]sendemail.enable::
Shawn O. Pearce2e4573b2009-06-02 09:09:50 -07002448+
2449If false Gerrit will not send email messages, for any reason,
2450and all other properties of section sendemail are ignored.
2451+
2452By default, true, allowing notifications to be sent.
2453
Shawn O. Pearce5c31bd72009-09-10 18:13:33 -07002454[[sendemail.from]]sendemail.from::
2455+
2456Designates what name and address Gerrit will place in the From
2457field of any generated email messages. The supported values are:
2458+
2459* `USER`
2460+
2461Gerrit will set the From header to use the current user's
David Pursehouse92463562013-06-24 10:16:28 +09002462Full Name and Preferred Email. This may cause messages to be
Shawn O. Pearce5c31bd72009-09-10 18:13:33 -07002463classified as spam if the user's domain has SPF or DKIM enabled
2464and <<sendemail.smtpServer,sendemail.smtpServer>> is not a trusted
2465relay for that domain.
2466+
2467* `MIXED`
2468+
Edwin Kempincdb0e002011-09-08 14:23:30 +02002469Shorthand for `${user} (Code Review) <review@example.com>` where
Shawn O. Pearce5c31bd72009-09-10 18:13:33 -07002470`review@example.com` is the same as <<user.email,user.email>>.
2471See below for a description of how the replacement is handled.
2472+
2473* `SERVER`
2474+
2475Gerrit will set the From header to the same name and address
2476it records in any commits Gerrit creates. This is set by
2477<<user.name,user.name>> and <<user.email,user.email>>, or guessed
2478from the local operating system.
2479+
2480* 'Code Review' `<`'review'`@`'example.com'`>`
2481+
2482If set to a name and email address in brackets, Gerrit will use
2483this name and email address for any messages, overriding the name
2484that may have been selected for commits by user.name and user.email.
Edwin Kempincdb0e002011-09-08 14:23:30 +02002485Optionally, the name portion may contain the placeholder `${user}`,
Shawn O. Pearce5c31bd72009-09-10 18:13:33 -07002486which is replaced by the Full Name of the current user.
2487
2488+
2489By default, MIXED.
2490
Shawn O. Pearce92a7fd12009-08-18 19:52:48 -07002491[[sendemail.smtpServer]]sendemail.smtpServer::
Shawn O. Pearceb0572c62009-06-01 14:18:22 -07002492+
2493Hostname (or IP address) of a SMTP server that will relay
2494messages generated by Gerrit to end users.
2495+
2496By default, 127.0.0.1 (aka localhost).
2497
Shawn O. Pearce92a7fd12009-08-18 19:52:48 -07002498[[sendemail.smtpServerPort]]sendemail.smtpServerPort::
Shawn O. Pearceb0572c62009-06-01 14:18:22 -07002499+
2500Port number of the SMTP server in sendemail.smtpserver.
2501+
Shawn O. Pearce6e9a83f2009-11-02 10:30:48 -08002502By default, 25, or 465 if smtpEncryption is 'ssl'.
2503
2504[[sendemail.smtpEncryption]]sendemail.smtpEncryption::
2505+
2506Specify the encryption to use, either 'ssl' or 'tls'.
2507+
2508By default, 'none', indicating no encryption is used.
2509
2510[[sendemail.sslVerify]]sendemail.sslVerify::
2511+
2512If false and sendemail.smtpEncryption is 'ssl' or 'tls', Gerrit
2513will not verify the server certificate when it connects to send
2514an email message.
2515+
2516By default, true, requiring the certificate to be verified.
Shawn O. Pearceb0572c62009-06-01 14:18:22 -07002517
Shawn O. Pearce92a7fd12009-08-18 19:52:48 -07002518[[sendemail.smtpUser]]sendemail.smtpUser::
Shawn O. Pearceb0572c62009-06-01 14:18:22 -07002519+
2520User name to authenticate with, if required for relay.
2521
Shawn O. Pearce92a7fd12009-08-18 19:52:48 -07002522[[sendemail.smtpPass]]sendemail.smtpPass::
Shawn O. Pearceb0572c62009-06-01 14:18:22 -07002523+
2524Password for the account named by sendemail.smtpUser.
2525
Shawn O. Pearce92a7fd12009-08-18 19:52:48 -07002526[[sendemail.allowrcpt]]sendemail.allowrcpt::
Shawn O. Pearce219a8ee2009-06-01 18:13:57 -07002527+
2528If present, each value adds one entry to the whitelist of email
2529addresses that Gerrit can send email to. If set to a complete
2530email address, that one address is added to the white list.
2531If set to a domain name, any address at that domain can receive
2532email from Gerrit.
2533+
2534By default, unset, permitting delivery to any email address.
2535
Shawn O. Pearce02aacbc2012-06-12 13:44:22 -07002536[[sendemail.includeDiff]]sendemail.includeDiff::
2537+
Bruce Zueb00ff32012-11-27 17:38:10 +08002538If true, new change emails and merged change emails from Gerrit
2539will include the complete unified diff of the change.
2540Variable maxmimumDiffSize places an upper limit on how large the
2541email can get when this option is enabled.
Shawn O. Pearce02aacbc2012-06-12 13:44:22 -07002542+
2543By default, false.
2544
Shawn O. Pearce28a950b2012-06-12 14:36:34 -07002545[[sendemail.maximumDiffSize]]sendemail.maximumDiffSize::
2546+
2547Largest size of unified diff output to include in an email. When
2548the diff exceeds this size the file paths will be listed instead.
2549Standard byte unit suffixes are supported.
2550+
2551By default, 256 KiB.
2552
Alex Blewitt9cca7402011-02-11 01:39:30 +00002553[[sendemail.importance]]sendemail.importance::
2554+
2555If present, emails sent from Gerrit will have the given level
2556of importance. Valid values include 'high' and 'low', which
2557email clients will render in different ways.
2558+
2559By default, unset, so no Importance header is generated.
2560
2561[[sendemail.expiryDays]]sendemail.expiryDays::
2562+
2563If present, emails sent from Gerrit will expire after the given
2564number of days. This will add the Expiry-Date header and
2565email clients may expire or expunge mails whose Expiry-Date
2566header is in the past. This should be a positive non-zero
2567number indicating how many days in the future the mails
2568should expire.
2569+
2570By default, unset, so no Expiry-Date header is generated.
2571
Shawn O. Pearcedba97642011-09-07 20:12:31 -07002572
Yuxuan 'fishy' Wang3fba03a2013-12-10 15:08:11 -08002573[[site]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08002574=== Section site
Shawn O. Pearcedba97642011-09-07 20:12:31 -07002575
2576[[site.checkUserAgent]]site.checkUserAgent::
2577+
2578If true the server checks the User-Agent HTTP header and sends the
2579correct JavaScript to the client as part of the initial page load.
2580This usually reduces a round-trip for the client, allowing the UI to
2581start more quickly. If false, a tiny JavaScript loader is sent to the
2582client instead to determine the correct code to use. Default is true.
2583
2584[[site.refreshHeaderFooter]]site.refreshHeaderFooter::
2585+
2586If true the server checks the site header, footer and CSS files for
2587updated versions. If false, a server restart is required to change
2588any of these resources. Default is true, allowing automatic reloads.
2589
Shawn O. Pearce6bd04fd2012-04-05 14:39:22 -07002590[[site.enableDeprecatedQuery]]site.enableDeprecatedQuery::
2591+
2592If true the deprecated `/query` URL is available to return JSON
2593and text results for changes. If false, the URL is disabled and
2594returns 404 to clients. Default is true, enabling `/query`.
2595
Yuxuan 'fishy' Wang3fba03a2013-12-10 15:08:11 -08002596[[ssh-alias]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08002597=== Section ssh-alias
Shawn O. Pearce521380a2012-05-11 14:57:56 -07002598
2599Variables in section ssh-alias permit the site administrator to alias
2600another command from Gerrit or a plugin into the `gerrit` command
2601namespace. To alias `replication start` to `gerrit replicate`:
2602
2603----
2604[ssh-alias]
2605 replicate = replication start
2606----
Shawn O. Pearcedba97642011-09-07 20:12:31 -07002607
Yuxuan 'fishy' Wang3fba03a2013-12-10 15:08:11 -08002608[[sshd]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08002609=== Section sshd
Shawn O. Pearce9410f2c2009-05-14 10:26:47 -07002610
Shawn O. Pearce92a7fd12009-08-18 19:52:48 -07002611[[sshd.listenAddress]]sshd.listenAddress::
Shawn O. Pearce1d3cb4442009-05-30 14:03:31 -07002612+
2613Specifies the local addresses the internal SSHD should listen
2614for connections on. The following forms may be used to specify
2615an address. In any form, `:'port'` may be omitted to use the
2616default of 29418.
2617+
2618* 'hostname':'port' (for example `review.example.com:29418`)
2619* 'IPv4':'port' (for example `10.0.0.1:29418`)
2620* ['IPv6']:'port' (for example `[ff02::1]:29418`)
Edwin Kempincdb0e002011-09-08 14:23:30 +02002621* *:'port' (for example `*:29418`)
Shawn O. Pearce1d3cb4442009-05-30 14:03:31 -07002622
2623+
2624If multiple values are supplied, the daemon will listen on all
2625of them.
2626+
Shawn O. Pearce6af6f5f2010-06-08 17:38:43 -07002627To disable the internal SSHD, set listenAddress to `off`.
2628+
Shawn O. Pearce1d3cb4442009-05-30 14:03:31 -07002629By default, *:29418.
2630
James Y Knight910bd862011-01-11 20:05:56 -05002631[[sshd.advertisedAddress]]sshd.advertisedAddress::
2632+
2633Specifies the addresses clients should be told to connect to.
2634This may differ from sshd.listenAddress if a firewall based port
2635redirector is being used, making Gerrit appear to answer on port
263622. The following forms may be used to specify an address. In any
2637form, `:'port'` may be omitted to use the default SSH port of 22.
2638+
2639* 'hostname':'port' (for example `review.example.com:22`)
2640* 'IPv4':'port' (for example `10.0.0.1:29418`)
2641* ['IPv6']:'port' (for example `[ff02::1]:29418`)
2642
2643+
2644If multiple values are supplied, the daemon will advertise all
2645of them.
2646+
2647By default, sshd.listenAddress.
2648
Shawn O. Pearce92a7fd12009-08-18 19:52:48 -07002649[[sshd.tcpKeepAlive]]sshd.tcpKeepAlive::
Shawn O. Pearcefc9081f2009-05-14 10:26:59 -07002650+
2651If true, enables TCP keepalive messages to the other side, so
2652the daemon can terminate connections if the peer disappears.
2653+
David Ostrovskye5b7f1a2013-10-23 21:10:39 +02002654Only effective when `sshd.backend` is set to `MINA`.
2655+
Shawn O. Pearcefc9081f2009-05-14 10:26:59 -07002656By default, true.
2657
Shawn O. Pearce1a4580b2009-11-19 17:37:10 -08002658[[sshd.threads]]sshd.threads::
2659+
2660Number of threads to use when executing SSH command requests.
2661If additional requests are received while all threads are busy they
David Pursehouse221d4f62012-06-08 17:38:08 +09002662are queued and serviced in a first-come-first-served order.
Shawn O. Pearce1a4580b2009-11-19 17:37:10 -08002663+
2664By default, 1.5x the number of CPUs available to the JVM.
2665
Nico Sallembienfc53f7f2010-05-18 16:40:10 -07002666[[sshd.batchThreads]]sshd.batchThreads::
2667+
2668Number of threads to allocate for SSH command requests from
Fredrik Luthander46843022012-03-13 16:11:02 +01002669link:access-control.html#non-interactive_users[non-interactive users].
2670If equals to 0, then all non-interactive requests are executed in the same
2671queue as interactive requests.
Nico Sallembienfc53f7f2010-05-18 16:40:10 -07002672+
2673Any other value will remove the number of threads from the queue
2674allocated to interactive users, and create a separate thread pool
2675of the requested size, which will be used to run commands from
2676non-interactive users.
2677+
2678If the number of threads requested for non-interactive users is larger
2679than the total number of threads allocated in sshd.threads, then the
David Pursehouse92463562013-06-24 10:16:28 +09002680value of sshd.threads is increased to accommodate the requested value.
Nico Sallembienfc53f7f2010-05-18 16:40:10 -07002681+
2682By default, 0.
2683
Kenny Root15ac1b82010-02-24 00:29:20 -08002684[[sshd.streamThreads]]sshd.streamThreads::
2685+
2686Number of threads to use when formatting events to asynchronous
2687streaming clients. Event formatting is multiplexed onto this thread
2688pool by a simple FIFO scheduling system.
2689+
2690By default, 1 plus the number of CPUs available to the JVM.
2691
Edwin Kempinb5df3b82011-10-10 11:31:14 +02002692[[sshd.commandStartThreads]]sshd.commandStartThreads::
Shawn O. Pearced6296552011-05-15 13:56:30 -07002693+
2694Number of threads used to parse a command line submitted by a client
2695over SSH for execution, create the internal data structures used by
2696that command, and schedule it for execution on another thread.
2697+
2698By default, 2.
2699
Shawn O. Pearce8a0bf362010-11-05 17:49:41 -07002700[[sshd.maxAuthTries]]sshd.maxAuthTries::
2701+
2702Maximum number of authentication attempts before the server
2703disconnects the client. Each public key that a client has loaded
2704into its local agent counts as one auth request. Users can work
2705around the server's limit by loading less keys into their agent,
2706or selecting a specific key in their `~/.ssh/config` file with
2707the `IdentityFile` option.
2708+
2709By default, 6.
2710
2711[[sshd.loginGraceTime]]sshd.loginGraceTime::
2712+
2713Time in seconds that a client has to authenticate before the server
2714automatically terminates their connection. Values should use common
2715unit suffixes to express their setting:
2716+
2717* s, sec, second, seconds
2718* m, min, minute, minutes
2719* h, hr, hour, hours
2720* d, day, days
2721
2722+
2723By default, 2 minutes.
2724
Christian Aistleitner3d794592013-04-08 00:19:40 +02002725[[sshd.idleTimeout]]sshd.idleTimeout::
2726+
2727Time in seconds after which the server automatically terminates idle
2728connections (or 0 to disable closing of idle connections). Values
2729should use common unit suffixes to express their setting:
2730+
2731* s, sec, second, seconds
2732* m, min, minute, minutes
2733* h, hr, hour, hours
2734* d, day, days
2735
2736+
2737By default, 0.
2738
Shawn O. Pearce8a0bf362010-11-05 17:49:41 -07002739[[sshd.maxConnectionsPerUser]]sshd.maxConnectionsPerUser::
2740+
2741Maximum number of concurrent SSH sessions that a user account
2742may open at one time. This is the number of distinct SSH logins
David Pursehouse221d4f62012-06-08 17:38:08 +09002743that each user may have active at one time, and is not related to
Shawn O. Pearce8a0bf362010-11-05 17:49:41 -07002744the number of commands a user may issue over a single connection.
2745If set to 0, there is no limit.
2746+
2747By default, 64.
2748
Shawn O. Pearce92a7fd12009-08-18 19:52:48 -07002749[[sshd.cipher]]sshd.cipher::
Shawn O. Pearce0bf2f522009-05-14 11:02:03 -07002750+
2751Available ciphers. To permit multiple ciphers, specify multiple
2752`sshd.cipher` keys in the configuration file, one cipher name
2753per key. Cipher names starting with `+` are enabled in addition
2754to the default ciphers, cipher names starting with `-` are removed
2755from the default cipher set.
2756+
2757Supported ciphers: aes128-cbc, aes128-cbc, aes256-cbc, blowfish-cbc,
27583des-cbc, none.
2759+
2760By default, all supported ciphers except `none` are available.
2761
Shawn O. Pearce92a7fd12009-08-18 19:52:48 -07002762[[sshd.mac]]sshd.mac::
Shawn O. Pearce0bf2f522009-05-14 11:02:03 -07002763+
2764Available MAC (message authentication code) algorithms. To permit
2765multiple algorithms, specify multiple `sshd.mac` keys in the
2766configuration file, one MAC per key. MAC names starting with `+`
2767are enabled in addition to the default MACs, MAC names starting with
2768`-` are removed from the default MACs.
2769+
2770Supported MACs: hmac-md5, hmac-md5-96, hmac-sha1, hmac-sha1-96.
2771+
2772By default, all supported MACs are available.
2773
Alex Blewitt7efb06f2013-04-01 12:46:48 -04002774[[sshd.kerberosKeytab]]sshd.kerberosKeytab::
2775+
2776Enable kerberos authentication for SSH connections. To permit
2777kerberos authentication, the server must have a host principal
2778(see `sshd.kerberosPrincipal`) which is acquired from a keytab.
2779This must be provisioned by the kerberos administrators, and is
2780typically installed into `/etc/krb5.keytab` on host machines.
2781+
2782The keytab must contain at least one `host/` principal, typically
2783using the host's canonical name. If it does not use the
2784canonical name, the `sshd.kerberosPrincipal` should be configured
2785with the correct name.
2786+
2787By default, not set and so kerberos authentication is not enabled.
2788
2789[[sshd.kerberosPrincipal]]sshd.kerberosPrincipal::
2790+
2791If kerberos authentication is enabled with `sshd.kerberosKeytab`,
2792instead use the given principal name instead of the default.
2793If the principal does not begin with `host/` a warning message is
2794printed and may prevent successful authentication.
2795+
2796This may be useful if the host is behind an IP load balancer or
2797other SSH forwarding systems, since the principal name is constructed
2798by the client and must match for kerberos authentication to work.
2799+
2800By default, `host/canonical.host.name`
2801
Shawn Pearce318bfca2013-10-17 22:15:38 -07002802[[sshd.requestLog]]sshd.requestLog::
2803+
2804Enable (or disable) the `'$site_path'/logs/sshd_log` request log.
2805If enabled, a request log file is written out by the SSH daemon.
2806+
David Ostrovsky8e4a9902013-11-19 23:57:48 +01002807`log4j.appender` with the name `sshd_log` can be configured to overwrite
2808programmatic configuration.
2809+
Shawn Pearce318bfca2013-10-17 22:15:38 -07002810By default, true.
2811
Yuxuan 'fishy' Wang3fba03a2013-12-10 15:08:11 -08002812[[suggest]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08002813=== Section suggest
Shawn O. Pearce07bd6fb2011-04-29 19:15:47 -07002814
Dave Borowitz1ae8c532012-03-09 18:39:40 -08002815[[suggest.accounts]]suggest.accounts::
Shawn O. Pearce07bd6fb2011-04-29 19:15:47 -07002816+
Dave Borowitz45baa892012-02-23 16:43:05 -08002817If `true`, visible user accounts (according to the value of
2818`accounts.visibility`) will be offered as completion suggestions
2819when adding a reviewer to a change, or a user to a group.
Shawn O. Pearce07bd6fb2011-04-29 19:15:47 -07002820+
Dave Borowitz45baa892012-02-23 16:43:05 -08002821If `false`, account suggestion is disabled.
Shawn O. Pearce07bd6fb2011-04-29 19:15:47 -07002822+
Dave Borowitz45baa892012-02-23 16:43:05 -08002823Older configurations may also have one of the `accounts.visibility`
2824values for this field, including `OFF` as a synonym for `NONE`. If
2825`accounts.visibility` is also set, that value overrides this one;
2826otherwise, this value applies to both `suggest.accounts` and
2827`accounts.visibility`.
Edwin Kempin42488812011-05-20 03:11:43 +02002828+
Dave Borowitz45baa892012-02-23 16:43:05 -08002829New configurations should prefer the boolean value for this field
2830and an enum value for `accounts.visibility`.
Shawn O. Pearce07bd6fb2011-04-29 19:15:47 -07002831
Edwin Kempinf957dc22012-10-19 20:41:18 +02002832[[suggest.from]]suggest.from::
2833+
2834The number of characters that a user must have typed before suggestions
2835are provided. If set to 0, suggestions are always provided.
2836+
2837By default 0.
2838
Yuxuan 'fishy' Wang3fba03a2013-12-10 15:08:11 -08002839[[theme]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08002840=== Section theme
Shawn O. Pearce2ba3ab42010-02-25 12:10:10 -08002841
2842[[theme.backgroundColor]]theme.backgroundColor::
2843+
2844Background color for the page, and major data tables like the all
2845open changes table or the account dashboard. The value must be a
2846valid HTML hex color code, or standard color name.
2847+
Chad Horohoebbdf7482012-11-13 18:23:15 -08002848By default white, `FFFFFF`.
Shawn O. Pearce2ba3ab42010-02-25 12:10:10 -08002849
2850[[theme.topMenuColor]]theme.topMenuColor::
2851+
2852This is the color of the main menu bar at the top of the page.
2853The value must be a valid HTML hex color code, or standard color
Chad Horohoebbdf7482012-11-13 18:23:15 -08002854name.
2855+
2856By default white, `FFFFFF`.
Shawn O. Pearce2ba3ab42010-02-25 12:10:10 -08002857
2858[[theme.textColor]]theme.textColor::
2859+
2860Text color for the page, and major data tables like the all
2861open changes table or the account dashboard. The value must be a
2862valid HTML hex color code, or standard color name.
2863+
Chad Horohoebbdf7482012-11-13 18:23:15 -08002864By default dark grey, `353535`.
Shawn O. Pearce2ba3ab42010-02-25 12:10:10 -08002865
2866[[theme.trimColor]]theme.trimColor::
2867+
2868Primary color used as a background color behind text. This is
2869the color of the main menu bar at the top, of table headers,
2870and of major UI areas that we want to offset from other portions
2871of the page. The value must be a valid HTML hex color code, or
2872standard color name.
2873+
Chad Horohoebbdf7482012-11-13 18:23:15 -08002874By default a light grey, `EEEEEE`.
Shawn O. Pearce2ba3ab42010-02-25 12:10:10 -08002875
2876[[theme.selectionColor]]theme.selectionColor::
2877+
2878Background color used within a trimColor area to denote the currently
2879selected tab, or the background color used in a table to denote the
2880currently selected row. The value must be a valid HTML hex color
2881code, or standard color name.
2882+
Chad Horohoebbdf7482012-11-13 18:23:15 -08002883By default a pale blue, `D8EDF9`.
Shawn O. Pearce2ba3ab42010-02-25 12:10:10 -08002884
Andrew Hutchingscfd7abb2012-06-29 10:57:05 +01002885[[theme.changeTableOutdatedColor]]theme.changeTableOutdatedColor::
2886+
2887Background color used for patch outdated messages. The value must be
2888a valid HTML hex color code, or standard color name.
2889+
Edwin Kempinb0347332012-07-17 10:14:32 +02002890By default a shade of red, `F08080`.
Andrew Hutchingscfd7abb2012-06-29 10:57:05 +01002891
2892[[theme.tableOddRowColor]]theme.tableOddRowColor::
2893+
2894Background color for tables such as lists of open reviews for odd
2895rows. This is so you can have a different color for odd and even
2896rows of the table. The value must be a valid HTML hex color code,
2897or standard color name.
2898+
2899By default transparent.
2900
2901[[theme.tableEvenRowColor]]theme.tableEvenRowColor::
2902+
2903Background color for tables such as lists of open reviews for even
2904rows. This is so you can have a different color for odd and even
2905rows of the table. The value must be a valid HTML hex color code,
2906or standard color name.
2907+
2908By default transparent.
2909
Shawn O. Pearcea83bb1c2011-05-20 08:46:48 -07002910A different theme may be used for signed-in vs. signed-out user status
2911by using the "signed-in" and "signed-out" theme sections. Variables
2912not specified in a section are inherited from the default theme.
2913
2914----
2915[theme]
2916 backgroundColor = FFFFFF
2917[theme "signed-in"]
2918 backgroundColor = C0C0C0
2919[theme "signed-out"]
2920 backgroundColor = 00FFFF
2921----
2922
David Ostrovsky117c6032013-08-09 00:44:56 +02002923As example, here is the theme configuration to have the old green look:
2924
2925----
2926[theme]
2927 backgroundColor = FCFEEF
2928 textColor = 000000
2929 trimColor = D4E9A9
2930 selectionColor = FFFFCC
2931 topMenuColor = D4E9A9
2932 changeTableOutdatedColor = F08080
2933[theme "signed-in"]
2934 backgroundColor = FFFFFF
2935----
2936
Yuxuan 'fishy' Wang3fba03a2013-12-10 15:08:11 -08002937[[trackingid]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08002938=== Section trackingid
Goran Lungberg04132a12010-06-15 17:20:37 -07002939
Shawn O. Pearcee800b1e2010-06-16 17:33:43 -07002940Tagged footer lines containing references to external
2941tracking systems, parsed out of the commit message and
Shawn Pearceff61c8a2013-10-07 19:35:53 -07002942saved in Gerrit's database.
2943
2944After making changes to this section, existing changes
Shawn Pearce9f4de522013-11-29 11:57:53 -08002945must be reindexed with link:pgm-reindex.html[reindex].
Goran Lungberg04132a12010-06-15 17:20:37 -07002946
Edwin Kempinbb421f12011-08-25 11:19:00 +02002947The tracking ids are searchable using tr:<tracking id> or
Shawn O. Pearce91763a02010-06-16 15:39:33 -07002948bug:<tracking id>.
Goran Lungberg04132a12010-06-15 17:20:37 -07002949
2950----
2951[trackingid "jira-bug"]
2952 footer = Bugfix:
2953 match = JRA\\d{2,8}
2954 system = JIRA
2955
2956[trackingid "jira-feature"]
2957 footer = Feature
2958 match = JRA(\\d{2,8})
2959 system = JIRA
2960----
2961
2962[[trackingid.name.footer]]trackingid.<name>.footer::
2963+
2964A prefix tag that identify the footer line to parse for tracking ids.
Kevin Degi9af42ea2011-08-01 15:54:42 -06002965Several trackingid entries can have the same footer tag. A single
2966trackingid entry can have multiple footer tags. If multiple footer
2967tags are specified, each tag will be parsed separately.
Goran Lungberg04132a12010-06-15 17:20:37 -07002968(the trailing ":" is optional)
2969
2970[[trackingid.name.match]]trackingid.<name>.match::
2971+
Magnus Bäcke5611832011-02-02 08:57:15 +01002972A link:http://download.oracle.com/javase/6/docs/api/java/util/regex/Pattern.html[standard
2973Java regular expression (java.util.regex)] used to match the
2974external tracking id part of the footer line. The match can
2975result in several entries in the DB. If grouping is used in the
2976regex the first group will be interpreted as the tracking id.
Christian Aistleitner5cec3682013-03-16 23:02:37 +01002977Tracking ids longer than 32 characters will be ignored.
Goran Lungberg04132a12010-06-15 17:20:37 -07002978+
2979The configuration file parser eats one level of backslashes, so the
2980character class `\s` requires `\\s` in the configuration file. The
2981parser also terminates the line at the first `#`, so a match
2982expression containing # must be wrapped in double quotes.
2983
2984[[trackingid.name.system]]trackingid.<name>.system::
2985+
David Pursehouse221d4f62012-06-08 17:38:08 +09002986The name of the external tracking system (maximum 10 characters).
Goran Lungberg04132a12010-06-15 17:20:37 -07002987It is possible to have several trackingid entries for the same
2988tracking system.
2989
Yuxuan 'fishy' Wang3fba03a2013-12-10 15:08:11 -08002990[[transfer]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08002991=== Section transfer
Shawn O. Pearce6e4dfdd2010-05-12 17:26:08 -07002992
2993[[transfer.timeout]]transfer.timeout::
2994+
2995Number of seconds to wait for a single network read or write
2996to complete before giving up and declaring the remote side is
2997not responding. If 0, there is no timeout, and this server will
2998wait indefinitely for a transfer to finish.
2999+
3000A timeout should be large enough to mostly transfer the objects to
3001the other side. 1 second may be too small for larger projects,
3002especially over a WAN link, while 10-30 seconds is a much more
3003reasonable timeout value.
3004+
3005Defaults to 0 seconds, wait indefinitely.
3006
lincoln2be11602010-07-05 10:53:25 -03003007
Yuxuan 'fishy' Wang3fba03a2013-12-10 15:08:11 -08003008[[upload]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08003009=== Section upload
Yuxuan 'fishy' Wang3fba03a2013-12-10 15:08:11 -08003010
lincoln2be11602010-07-05 10:53:25 -03003011Sets the group of users allowed to execute 'upload-pack' on the
3012server, 'upload-pack' is what runs on the server during a user's
3013fetch, clone or repo sync command.
3014
3015----
3016[upload]
3017 allowGroup = GROUP_ALLOWED_TO_EXECUTE
3018 allowGroup = YET_ANOTHER_GROUP_ALLOWED_TO_EXECUTE
3019----
3020
3021[[upload.allowGroup]]upload.allowGroup::
3022+
3023Name of the groups of users that are allowed to execute 'upload-pack'
3024on the server. One or more groups can be set.
3025+
3026If no groups are added, any user will be allowed to execute
3027'upload-pack' on the server.
3028
3029
Yuxuan 'fishy' Wang3fba03a2013-12-10 15:08:11 -08003030[[user]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08003031=== Section user
Shawn O. Pearce0a351912009-06-01 08:14:46 -07003032
Shawn O. Pearce92a7fd12009-08-18 19:52:48 -07003033[[user.name]]user.name::
Shawn O. Pearce0a351912009-06-01 08:14:46 -07003034+
3035Name that Gerrit calls itself in Git when it creates a new Git
3036commit, such as a merge during change submission.
3037+
3038By default this is "Gerrit Code Review".
3039
Shawn O. Pearce92a7fd12009-08-18 19:52:48 -07003040[[user.email]]user.email::
Shawn O. Pearce0a351912009-06-01 08:14:46 -07003041+
3042Email address that Gerrit refers to itself as when it creates a
3043new Git commit, such as a merge commit during change submission.
3044+
3045If not set, Gerrit generates this as "gerrit@`hostname`", where
3046`hostname` is the hostname of the system Gerrit is running on.
3047+
3048By default, not set, generating the value at startup.
3049
Edwin Kempin0e02ded2011-09-16 15:10:14 +02003050[[user.anonymousCoward]]user.anonymousCoward::
3051+
David Pursehouse13b21902013-10-16 12:59:18 +09003052Username that is displayed in the Gerrit WebUI and in e-mail
Edwin Kempin0e02ded2011-09-16 15:10:14 +02003053notifications if the full name of the user is not set.
3054+
3055By default "Anonymous Coward" is used.
3056
Shawn O. Pearce0bf2f522009-05-14 11:02:03 -07003057
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08003058== File `etc/secure.config`
Shawn O. Pearcec5fed822009-11-17 16:10:10 -08003059The optional file `'$site_path'/etc/secure.config` overrides (or
3060supplements) the settings supplied by `'$site_path'/etc/gerrit.config`.
Shawn O. Pearce0d4037a2009-11-12 18:33:46 -08003061The file should be readable only by the daemon process and can be
3062used to contain private configuration entries that wouldn't normally
3063be exposed to everyone.
3064
Shawn O. Pearcec5fed822009-11-17 16:10:10 -08003065Sample `etc/secure.config`:
Shawn O. Pearce0d4037a2009-11-12 18:33:46 -08003066----
Shawn O. Pearce34f38cf2011-06-16 19:18:54 -07003067[auth]
3068 registerEmailPrivateKey = 2zHNrXE2bsoylzUqDxZp0H1cqUmjgWb6
Brad Larson3a6f0772012-07-25 11:41:22 -05003069 restTokenPrivateKey = 7e40PzCjlUKOnXATvcBNXH6oyiu+r0dFk2c=
Shawn O. Pearce34f38cf2011-06-16 19:18:54 -07003070
Shawn O. Pearce0d4037a2009-11-12 18:33:46 -08003071[database]
Shawn O. Pearce9d342a42009-12-16 15:49:05 -08003072 username = webuser
3073 password = s3kr3t
Shawn O. Pearce0d4037a2009-11-12 18:33:46 -08003074
3075[ldap]
Shawn O. Pearce9d342a42009-12-16 15:49:05 -08003076 password = l3tm3srch
Shawn O. Pearce0d4037a2009-11-12 18:33:46 -08003077
3078[httpd]
Shawn O. Pearce9d342a42009-12-16 15:49:05 -08003079 sslKeyPassword = g3rr1t
Shawn O. Pearce0d4037a2009-11-12 18:33:46 -08003080
3081[sendemail]
Shawn O. Pearce9d342a42009-12-16 15:49:05 -08003082 smtpPass = sp@m
Shawn O. Pearce7929d872011-05-15 13:33:15 -07003083
3084[remote "bar"]
3085 password = s3kr3t
Shawn O. Pearce0d4037a2009-11-12 18:33:46 -08003086----
3087
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08003088== File `etc/peer_keys`
Johan Bjork3e5ee302012-01-27 17:59:54 +01003089
3090The optional file `'$site_path'/etc/peer_keys` controls who can
3091login as the 'Gerrit Code Review' user, required for the link:cmd-suexec.html[suexec]
3092command.
3093
3094The format is one Base-64 encoded public key per line.
3095
3096
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08003097== Database system_config
Shawn O. Pearce7b405712009-05-08 18:27:53 -07003098
3099Several columns in the `system_config` table within the metadata
3100database may be set to control how Gerrit behaves.
Shawn O. Pearced2b73db2009-01-09 11:55:47 -08003101
3102[NOTE]
3103The contents of the `system_config` table are cached at startup
3104by Gerrit. If you modify any columns in this table, Gerrit needs
3105to be restarted before it will use the new values.
3106
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08003107=== Configurable Parameters
Shawn O. Pearced2b73db2009-01-09 11:55:47 -08003108
Shawn O. Pearce8e9c73b2009-05-08 17:38:25 -07003109site_path::
3110+
Shawn O. Pearced2b73db2009-01-09 11:55:47 -08003111Local filesystem directory holding the site customization assets.
3112Placing this directory under version control and/or backup is a
3113good idea.
Shawn O. Pearce8e9c73b2009-05-08 17:38:25 -07003114+
Shawn O. Pearcec5fed822009-11-17 16:10:10 -08003115Files in this directory provide additional configuration.
Shawn O. Pearce8e9c73b2009-05-08 17:38:25 -07003116+
Shawn O. Pearced2b73db2009-01-09 11:55:47 -08003117Other files support site customization.
Shawn O. Pearce8e9c73b2009-05-08 17:38:25 -07003118+
Dave Borowitz1e49e142013-04-09 12:14:57 -07003119* link:config-themes.html[Themes]
Shawn O. Pearced2b73db2009-01-09 11:55:47 -08003120
Shawn O. Pearce5500e692009-05-28 15:55:01 -07003121GERRIT
3122------
3123Part of link:index.html[Gerrit Code Review]
Yuxuan 'fishy' Wang99cb68d2013-10-31 17:26:00 -07003124
3125SEARCHBOX
3126---------